Re: [K12OSN] Direct output to a file

Jim Thomas (jthomas@bittware.com)
Fri, 21 Feb 2003 14:31:28 -0500


Matt wrote:
> 
> Does anyone here know how to direct output of a script to a file instead
> of the console?
> 
> I've tried  script-name > file but that doesn't work.
> I seem to recall something about a && will tell it to go to a file or
> something?

Hmmmm... that should have worked.  Maybe the script output is going to
stderr instead of stdout?  If so, you might try this:

# script-name > file 2>&1

This will send stderr's output to the same place as stdout.

If that doesn't work, you could also try using the script command:

# script log.txt
# script-name
# 

This is a bit different from redirecting the output to a file though, as
it logs everything - including anything you type - to a file called
log.txt.  But it might get you over the hump.

-- 
Jim Thomas            Principal Applications Engineer  Bittware, Inc
jthomas@bittware.com  http://www.bittware.com          (703) 779-7770
I thought I was wrong once, but I was mistaken.



_______________________________________________
K12OSN mailing list
K12OSN@redhat.com
https://listman.redhat.com/mailman/listinfo/k12osn
For more info see