In the example script below it is used to send to one or two email addresses, depending on which process is using the script. Do I need to add $3 to account for an additional email address or is $2 sufficient?
(
for file in /usr/app/tst/$1/MS_CASE_ST*.csv;
do
uuencode ${file} $(basename ${file})
done
) | mailx -s "MS_CASE_ST*.csv file contains data. Please Research" $2
An example of how the script, example.sh, is executed:
$ ./example.sh output email-1@web.com email-2@web.com
uuencode
? – Chris Davies Jul 12 '17 at 17:16uuencode "$file" "$(basename "$file")"
(and"$2"
or"${@:2}"
).${variable_name}
doesn’t mean what you think it does …, and maybe see also Bash quotes unescaped on command substitution. – Scott - Слава Україні Jul 12 '17 at 22:41