02-05-2010 07:38 AM
when I try to just redirect stderr it just seems to ignore it...
> ll | mailx -s "Test e-mail" bert 2> mail.stderr
> bert... User unknown
<$HOME>/dead.letter... Saved message in <$HOME>/dead.letter
Where $HOME is the home directory of the user account that I was logged in as.
Any help would be much appreciated.
Solved! Go to Solution.
02-05-2010 08:02 AM
It's been a long week! I don't know why I didn't redirect stdout as well in the first place.
As a matter of interest, why didn't my original command work?
Have a good week-end.
02-05-2010 08:17 AM
> As a matter of interest, why didn't my original command work?
The output messages you really wanted to collect are going to STDOUT not STDERR.
I could have suggested you do:
# # ll | mailx -s "Test e-mail" xxx 1>>/tmp/mylog
...and ignored STDERR entirely.
02-05-2010 04:40 PM
Because your assumptions and the programmer's about what goes to stderr were different.
With an interactive program like mailx, perhaps this is blurred.
Sometimes as JRF had, you should just log both.