Question : how to print all unix command mesage to a mail

my command:

%/usr/bin/rsync -Lpgtrzv --numeric-ids /afs/abc/RCS/projA /fs/abc/proj/valid/RCS/
building file list ... /afs/abc/RCS/projA : Permission denied
done
nothing to do

%/usr/bin/rsync -Lpgtrzv --numeric-ids /afs/abc/RCS/projA /fs/abc/proj/valid/RCS/ | mail -s "rsync /afs/abc/RCS/projA" [email protected]
/afs/pdx/proj/nwd/valid/RCS/wmt : Permission denied
nothing to do

My mail only show:
building file list ... done

how can i print all the full message to the mail?

thanks
hl

Answer : how to print all unix command mesage to a mail

or run the commands in a subshell, and redirect stdout and stderr of the subshell through a pipe to mailx eg.

#!/bin/sh

(
command-1
command-2
) 2>&1 | mail myemailadd

then you can dispense with tmp files
Random Solutions  
 
programming4us programming4us