Skip to content

Instantly share code, notes, and snippets.

Created November 26, 2012 03:04
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 anonymous/4146406 to your computer and use it in GitHub Desktop.
Save anonymous/4146406 to your computer and use it in GitHub Desktop.
verifica se a palavra esta contida ou não no texto
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