aspose file tools*
The moose likes Linux / UNIX and the fly likes less or > doesn't always work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "less or > doesn Watch "less or > doesn New topic
Author

less or > doesn't always work

sonny kher
Ranch Hand

Joined: Nov 06, 2001
Posts: 83
when I try to pipe output from a build file to less or to a file, it doens't always catch everything. Why so?
ant > tempFile only writes like a couple of lines when the screen stdout sees like 50
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
There are actually two output streams (corresponding to System.out and System.err in Java). The '>' redirection only redirects the basic output stream, not the errors stream..
To redirect the error stream use 2>


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Hi - One (among several) neat trick is:
some_command 2>&1 | tee logfile.txt
G.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: less or > doesn't always work