Click to See Complete Forum and Search --> : Shell help


weezle
07-20-2001, 01:26 PM
Hello all,

I am gettin a strange error when I attempt to run the following command:

#cat /usr/local/logfile.log | /usr/logs/report 2>/dev/null

Error: Broken pipe

I do not have clue what would cause this...has anyone else run across this before?

As always...thanks for your help!

Rob

nopun
07-20-2001, 02:43 PM
Could be /usr/logs/report is dying for some reason (thus breaking the receiving end of the pipe). Because you are redirecting stderr to /dev/null, you are not seeing any error messages from it. Try running the command without "2>/dev/null" to see if that's what's happening.

weezle
07-20-2001, 03:10 PM
Hello nopun,

I tried your suggestion. It came back with command not found - then broken pipe.

Here's a sample of what I am referring to:

/usr/local/report: 98877254.618: command not found

Sorry to say...but I am still clueless

Ig0r
07-20-2001, 03:21 PM
You can't pipe data to a file.
You need to use the > or >> operators.
> clears the file and writes the data.
>> appends the data to the end of the file.

nopun
07-20-2001, 04:59 PM
It becomes a bit clearer - I didn't stop to consider that /usr/logs/report was a data file (perhaps the name should have given it away? doh!)
Anways, it was trying to run it like it was a bash script (the first line of that file must be 98877....etc).
Still doesn't make much sense (that 2> stuff?), it looks as though you were meaning to use a proper command in there somewhere but missed it out? :confused:

weezle
07-21-2001, 11:51 AM
Actually 2>/dev/null tells the system to ONLY report back "usefull" information - ignore false replies...or more simply cleans up the command...

nopun
07-21-2001, 02:02 PM
Who told you that everything output via stderr is false and not useful? :eek: