BASH script quote problem

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

I have this bash script, as follows:

RECIP=scottmmorris at
SUBJECT="Running on `hostname`"
ls | mail -s ""$SUBJECT" - sent" "$RECIP"

I do get the mail at the scottmmorris at 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, sent at, - at,
suse-linux at  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?


More information about the PLUG mailing list