I have remove.sh
which contains:
rm -v test.tmp
And I have install.sh
which contains:
script remove.log -c './remove.sh'
What can I do so that whether or not test.tmp
exists, I don't see any rm
related messages on the screen but see removed 'test.tmp'
or rm: cannot remove 'test.tmp': No such file or directory
in remove.log
which the script command produces?
script -c remove.log 'your command' > /dev/null
. Thescript
command will capturestdout
andstderr
to your log file, and the redirection will suppress all terminal output from thescript
command. – larsks Feb 18 '12 at 00:06