jQuery in Action, 2nd edition*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "less or > doesn Watch "less or > doesn New topic

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

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
I agree. Here's the link: http://aspose.com/file-tools
subject: less or > doesn't always work
Similar Threads
closing browser leaves user logged on
Which is the Best practice to follow in Hibernate Mapping file...!
Tracking User's requests.
EJB QL on the exam
Random number generation