This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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 ~ 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
wood burning stoves
subject: less or > doesn't always work
Similar Threads
Random number generation
Tracking User's requests.
closing browser leaves user logged on
Which is the Best practice to follow in Hibernate Mapping file...!
EJB QL on the exam