[sllug-members]: stderr + less

Knight Walker kwalker at kobran.org
Thu May 4 13:00:03 MDT 2006


On Thu, 2006-05-04 at 12:44 -0600, Steve Dibb wrote:
> Is there a way to pipe stuff put out through stderr to less?
> 
> I'm trying to do "foo | less" but with no arguments, it displays the 
> help file on stderr, and I can't figure out how to page it.
> 
> *insert rant about stupid programs that don't have -h or --help*

I agree with the rant, especially when -h OUTPUTS TO STDERR.  Anyway,
the way I get around that is like this:

foo >& /tmp/foo.out
less /tmp/foo.out

The >& directs stderr to stdout which is then directed to /tmp/foo.out,
then I use less as normal.

There's also something you can do with >1&2 or something like that, but
I don't know that syntax.

-KW



More information about the sllug-members mailing list