Cameron Simpson
2017-10-10 06:11:14 UTC
/usr/local/bin/mutt -s $SUBJECT -i $MESSAGE -a $FILENAME --
shell is a tool for assembling command string arrays, and quoting is used to
demark single strings.
[...]
This proves you have a quoting problem. Enclose the parameters
When the variables are being evaluated by the shell, the quotes
during assignment are removed, and you you get is
The unterminated ' is handled more or less gracefully, but it
probably interferes with mutt's address detection. You can
now easily recognize the problem.
No, mutt noever considers it for addresses, because it is the subject string.When the variables are being evaluated by the shell, the quotes
during assignment are removed, and you you get is
The unterminated ' is handled more or less gracefully, but it
probably interferes with mutt's address detection. You can
now easily recognize the problem.
There's no "more or less gracefully", it is just a string.
The mutt command is invoked as an array of strings, thus (one per line):
/usr/local/bin/mutt
-s
Today's db backup
-i
path/to/message.txt
-a
/whatever/filename/there.is
--
***@tx.rr.com
There is no subsequent parsing or weird interpretation.
I'm running FreeBSD 10.3-RELEASE and the script is written in bash.
generally the Bourne shell. Nothing you're doing requires bash itself, but all
UNIX systems have /bin/sh.
Do you have any reasons not to stick to default sh? Do you use
any features specific to bash?
Ah, I see this has also been maddresses.any features specific to bash?
Cheers,
Cameron Simpson <***@cskk.id.au> (formerly ***@zip.com.au)