Last active
April 2, 2020 19:14
-
-
Save ndvo/b3ec64ede425ad8f458df00109d3b3b9 to your computer and use it in GitHub Desktop.
Verifica se um arquivo está contido em outro. A ordem não é importante.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
primeiro=$1; | |
segundo=$2; | |
for linha in $(cat $primeiro); do | |
if ! [[ $(grep "^$linha$" $segundo) ]]; then | |
echo "$primeiro não está contido em $segundo"; | |
exit 1; | |
fi; | |
done; | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment