[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can less read its input from the stderr ? How ?



On Mon, Jul 27, 1998 at 09:32:45PM +0300, shaul@rakefet.debian.org wrote:
> Supose I have a program that output long text to stderr. Can I use the less 
> command to page in it ? How ?
> Can I switch the stdout with the stderr ?

command 2>&1 | less

 you can redirect stderr (fd 2) with 2> file  or 2>&1 (stderr goes to same
place as stdout) -- this is useful for a few things.. like redirecting ALL
output to a file.. like:

reallyverboseprogram > /dev/null 2>&1

note that this is not the same as 2>&1 > /dev/null -- as this redirect
stderr to the terminal.. then redirects stdout to /dev/null -- while err
is still going to terminal

hope that helps =)

Raz..

-- 
 [ Razathorn <fileland@sound.net>                                 ]
 [ PGP public key http://www.sound.net/~fileland/pubkey.shtml     ]
 [ Finger Print: B8 9B 4B F5 67 1C A3 86  2F 91 F2 81 08 08 79 49 ]


--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: