Skip to content

Instantly share code, notes, and snippets.

@ndvo
Last active April 2, 2020 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndvo/b3ec64ede425ad8f458df00109d3b3b9 to your computer and use it in GitHub Desktop.
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.
#!/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