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

Re: using netcat with badblocks output



On Tue, Mar 09, 2004 at 12:43:54PM -0600, Matt Wehland wrote:
> If I try redirecting the output with '>' into netcat, badblocks complains 
> about bad arguments.

">" is for redirecting stdout to a file.  "|" is for redirecting to a
program.

> Is there a way to redirect the output file into netcat, or is this one of 
> those things that I need to redirect STout and STerr (I think those might be 
> the terms) into netcat?

If badblocks is writing to stderr instead of stdout, you just need to
add "2>&1" before "|".  (That redirects file descriptor 2, stderr, to
the same thing as fd 1, stdout.)

Isn't shell syntax fun?

Steve
-- 
steve@silug.org           | Southern Illinois Linux Users Group
(618)398-7360             | See web site for meeting details.
Steven Pritchard          | http://www.silug.org/

-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.