slackware question
Steve Holmes
steve at holmesgrown.com
Sat Feb 21 10:10:17 EST 2004
I should point out some further issues with piping output to less.
Many commands will work as mentioned in previous messages but some
will not and here is briefly why. Some commands for example have a
help option invoked with -h or --help. I just sight this as an
example. When doing this, some times the command help output will be
written to STDERR. A normal pipe with '|' will not pick up data from
STDERR;; it only picks up STDOUT normally. To get around this, just
type something like this.
command --help |less 2>&1
the '2>&1' part links file descriptor 1 and 2 together and includes
them both in the pipe. #1 is STDOUT and #2 is STDERR. Hope I didn't
confuse things too much but I've piped stuff to less and come up with
an empty display or what less thinks is an empty file and this is how
to get around that.
HTH.
On Fri, Feb 20, 2004 at 12:11:40AM -0600, Kenny Hitt wrote:
> Hi. Pay attention to the punctuation in the example.
> You use a pipe. for example, the line
> ls |less
>
> will pipe the output from the ls command into less.
> BTW, pipes are standard Unix so it should work on any distro.
>
> Hope this helps.
>
> Kenny
--
HolmesGrown Solutions
The best solutions for the best price!
http://ld.net/?holmesgrown
More information about the Speakup
mailing list