Computing.Net > Forums > Unix > Standard Input with Bourne Shell Script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Standard Input with Bourne Shell Script

Reply to Message Icon

Name: Iggystar
Date: August 29, 2000 at 07:35:51 Pacific
Comment:

I am trying to write a scipt that can work with a utility on one of my switches. The switch has some error logging. As it finds errors it's makes a small file (lets call it smallerror) that it appends to a larger file that has all my errors (lets call that bigerror)

The switch will also pipe the smallerror file into scripts that I have written. I want to write a script that will grep for data in smallerror and then react appropriately. The problem is, my script is only meaningful if it is run at the time the error is detected so I cant use the cron command to schedule my script, it needs to be as soon as the switch detects the error. The switch will do this for me, if I knew how the write the script but I have some problems.

I have 2 problems, one you guys cant help me with and 1 that maybe you can.

1) I dont know exactly what the switch means by it 'pipes' the info to my script. I'm assuming that it does something like this:

cat smallerror | myscript

but I cant be certain till I get my script working. You guys cant really help me with this one.

2) BUT you can help me with this. Assume that what I say is true and that the switch is using the cat command to pipe the data. How do I get the script to work with info that is piped in that way? I know how to use $0, $1, $2, etc to get info entered after the command line of my script, but I do not know how to work with info that gets piped in. I have a feeling that it's a simple fix but I've surfed around and asked around and I dont have anything.

Last time I worked with unix was 10 years ago so I may not be giving info that you need to solve this, but anything you could tell me would be appreciated. Thanks.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


X-windown Pascal or Ada-95 on Sco U...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Standard Input with Bourne Shell Script

Bourne shell script www.computing.net/answers/unix/bourne-shell-script/4316.html

Write a Bourne Shell Script--help! www.computing.net/answers/unix/write-a-bourne-shell-scripthelp/2055.html

Bourne shell script >>>>SOS www.computing.net/answers/unix/bourne-shell-script-sos/4349.html