logging a bash script using sudo and time
I regularly run a script with time and sudo. e.g.
> time sudo echo 'hi mom'
I've set up the sudoers file so that one script (represented in my
example as `echo`) can be run as sudo by my user account without a
Now I want to log the entire output to a log file as well as display
it on the screen.
> time sudo echo 'hi mom' | tee | logger -f /var/log/hiMom
Only that doesn't work :-) Time is only on the screen, not in the log
file, and /var/log/hiMom is empty, regardless of the permissions on
Can someone explain the redirection going on here in a way I can grok?