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

Re: Bash equivalent to DOS /p



On Sat, Jul 17, 2004 at 08:00:51AM +0800, John Summerfield wrote:
> 
> >>>Elijah
> >>>     
> >>>
> >>That works for regular output.  However, some programs also emit
> >>error messages onto stderr.  The above command will *not* redirect
> >>error messages into less, so they might mess up the pagination.
> >>To get error messages piped through less, use
> >>
> >>	command 2>&1 | less
> >>   
> >>
> >
> >dude! i've been trying to do that for months.  tahnks!
> >
> >as an aside, did /p in DOS redirect stderr, too?  it's been so long
> >...
> > 
> >
> slash-p is specific to the dir command. DOS also has more.
> 
> I'm more familiar with OS/2 where one has to redirect stderr as in the 
> example above. I believe that's also true on Windwoes.
> 
> I suppose for completeness we should mention tee.
> 
> tee writes its stdin to a file (which you name on the commandline) and 
> to stdout. It's useful for keeping a record of events.
> 
> $ apt-get -b source kernel-image-2.6.6-1-386 2>&1 | tee building-kernels
> 
> We've also mentioned redirection. These two are different:
> $ apt-get -b source kernel-image-2.6.6-1-386 >one 2>&1
> $ apt-get -b source kernel-image-2.6.6-1-386 2>&1 >one
> 
> This can be handy too::
> $ apt-get -b source kernel-image-2.6.6-1-386 >one 2>two
> 
> and there's always this:
> 
> $ apt-get -b source kernel-image-2.6.6-1-386 >>one 2>>two
> 
> I'll leave you to RTFM to discover what these do and whether I've made 
> any mistakes:-)
> 
> 
> -- 
> 
> Cheers
> John

# kbdrate
atkbd.c: Spurious ACK on isa0060/serio0. Some program like XFree86,
might be trying to access hardware directly.
atkbd.c: Spurious ACK on isa0060/serio0. Some program like XFree86,
might be trying to access hardware directly.
Typematic Rate set to 10.9 cps (delay = 250ms)

How do I get all that output (from kbdrate) into krate.txt.
So far I've only managed to get the last line into krate.txt.

Chris.
======



Reply to: