[sllug-members]: stderr + less

Doug Beattie dbb at sllug.org
Thu May 4 14:19:49 MDT 2006


If you want even more control, as in you want your keystrokes to be
input to the program instead of "less", and you want the output to
be viewable after "foo" stops running, you could do the following:
 foo 2>&1 | tee -a <somefilename>

Stderr (fd 2) of foo is sent to foo's stdout (fd 1) then piped to the
"tee" program which allows the output to go to both the screen and to
a file simultaneously. "foo" still continues to gets its input (fd 0)
or stdin from the keyboard.
After the fact, you can then "vi" or "less" the file the "tee" sent the
output to.

Doug

On Thu, May 04, 2006 at 02:50:26PM -0600, Walt Haas wrote:
> Steve Dibb <steve at wonkabar.org> 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.
> 
> foo 2>&1|less
> 
> -------
> Walt Haas          The Web Site Doctor - Cures Sick Web Sites
> (801) 534-1262     http://thewebsitedoctor.net
> ______________________________________________________________________
> See http://www.sllug.org/ for latest SLLUG news, information, links.
> Join SLLUG and other UT LUG members on irc.FreeNode.net channel #Utah
> sllug-members at sllug.org
> http://www.sllug.org/cgi-bin/mailman/listinfo/sllug-members

-- 


More information about the sllug-members mailing list