From: dan.hatton on Tuesday, June 17, 2003 3:30 PM
An obvious difference between the command you tried directly, which worked, and the command in the script, which didn't, is the "2" in kill -9 $pid 2>/dev/null. I don't know what purpose, if any, it serves, and maybe you'd be better off without it.
The '2>' term is redirecting any syserr output (in this case to the null device, effectively ignoring it).
IIRC the usual '>' and '>>' are really just short forms of '1>' and '1>>', which is redirecting any syslog output.
In the same you can append syserr output with '2>>'.
so if you want to capture both syslog and syserr output to the same file you can use something like;
snafu >foo.bar 2>foo.bar
or, my favourite,
snafu >foo.bar 2>&1
Regards,
Keith ____________ fsck early and fsck often!! - anon