Se a Declaração não estiver avaliada como esperado.
Verificar o seu script com ShellCheck (encontra erros em seus scripts de shell) fornece as seguintes sugestões:
$ shellcheck myscript
Line 1:
check=$(lynx -source $1 | grep -i $2)
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Line 5:
/usr/local/bin/sendemail -o tls=yes -f ***@gmail.com -t\
^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.
Line 6:
[email protected] -s smtp.gmail.com:587 -xu ***@gmail.com -xp *** -u\
^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.
^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.
Line 7:
$1 -m "contains the word " $2 ".";
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
Line 10:
/usr/local/bin/sendemail -o tls=yes -f ***@gmail.com -t\
^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.
Line 11:
[email protected] -s smtp.gmail.com:587 -xu ***@gmail.com -xp *** -u\
^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.
^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.
Line 12:
$1 -m "does not contain the word " $2 ".";
^-- SC2086: Double quote to prevent globbing and word splitting.
^-- SC2086: Double quote to prevent globbing and word splitting.
$
Veja os links a seguir para explicação das sugestões: