Redirecting STDOUT



I am in the process of debugging a script and I would like to have the
output of stdout redirected to a file.

After reading about redirection on the Internet, I was under the
impression the following would redirect stdout to a file, but I cannot
seem to get it to work.

tar -cvzf root.tgz /root > /dev/null 2>/home/jay/tarlog

I'm sure it is something simple I am doing wrong, but I am not seeing it.

Thanks for your help.

Jay


_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: STDERR and STDOUT redirection from within a vbs script
    ... > I have to use some vbs script, ... > Is there a simple way to force redirection of STDOUT and STDERR from ... > redirect the stderr and stdout to these files. ...
    (microsoft.public.scripting.vbscript)
  • Setting variable inside if - new (?) twist to an old question
    ... Executing the script ... a subshell when redirection occurs. ... would not spawn a subshell here. ...
    (comp.unix.shell)
  • Re: How can I get this redirect to work? (and this mail function)
    ... return TRUE after the first header() call, ... Even on a redirection header the script continues to run until it ... As soon as you do something which sends the headers the user can abort the connection. ...
    (comp.lang.php)
  • Re: Reg Crontab
    ... Instead of a redirection add an echo command to the script. ... Best thing is to handle the redirection in the script; that way you can put a timestamp into the log file name. ...
    (AIX-L)
  • Re: Bad file descriptor
    ... > But is there any good reason for not running it as ... >>if I run the script without any redirection, ... *** use them in pipelines nor with file redirection. ... is directly called from the command-line, the Win32 bug doesn't have ...
    (comp.lang.perl.misc)