BASH script quote problem

Scott Morris scottmmorris at hotpop.com
Thu Nov 2 14:59:49 MST 2006


I have this bash script, as follows:

#!/bin/sh
RECIP=scottmmorris at hotpop.com
SUBJECT="Running on `hostname`"
ls | mail -s ""$SUBJECT" - sent" "$RECIP"

I do get the mail at the scottmmorris at hotpop.com account, but the
subject is only "Running", and it has been "sent" to other recipients,
which correspond to the words missing in the rest of the subject, i.e.
on at suse-linux.site, sent at suse-linux.site, - at suse-linux.site,
suse-linux at suse-linux.site.  Evidently, it is taking each word to be a
recipient on the local machine (the hostname of this box is 'suse-linux').

I would like the subject to actually be:
Running on suse-linux - sent

Any thoughts on how this could be accomplished?

Scott




More information about the PLUG mailing list