[PLUG] Shell script error explanation needed
Rich Shepard
rshepard at appl-ecosys.com
Thu Aug 11 15:49:24 UTC 2016
On Thu, 11 Aug 2016, chris (fool) mccraw wrote:
> Be that as it may, the shell script would have said "/path/to/mail.list -
> file not found" if it was *using* that full path, so you are still (IMHO)
> looking for an unqualified pathname use.
The test script ran correctly.
test-1.sh:
#!/bin/bash
while read LINE; do
ADDR=$(echo $LINE | cut -d: -f1)
GRTG=$(echo $LINE | cut -d: -f2)
m4 -D GREETING="$GRTG" test-1.m4 | mail -s 'Testing 1, 2, 3' $ADDR
done < test-mail.list
test-1.m4:
GREETING:
This is a test message. That's all.
test-mail.list:
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
rshepard at twodogs.us:Rich
command issued:
at -f ~/test-1.sh 08:40 am
I just verified that leaving off the '-f' flag prevents the command from
being added to the at queue; the shell reports:
syntax error. Last token seen: /
Garbled time
Wonder what happened.
Thanks,
Rich
More information about the PLUG
mailing list