Created
November 26, 2012 03:04
-
-
Save anonymous/4146406 to your computer and use it in GitHub Desktop.
verifica se a palavra esta contida ou não no texto
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
if [ -z "$2" ]; then | |
echo "usage: $0 texto palavra1 [palavra2 .. palavraN]" >&2 | |
exit 1 | |
fi | |
TEXTO=$1 | |
shift | |
echo "no texto '$TEXTO'" | |
for i in "$@" ; do | |
case "$TEXTO" in | |
*$i*) echo "'$i' esta contido" ;; | |
*) echo "'$i' nao esta contido";; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment