Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to delet ipc

Status
Not open for further replies.

aharrris84

Technical User
Dec 3, 2003
2
US
I am writing a script that will delete all of the ipc's with ipcrm command. The problem that I have is that I don't know how to tell which switch to use for the 3 different types. Anyone have a good idea of how I can do this.
 
Sorry I don't think I was clear in what I was needing. I know which switches to use, but thanks for replying. What I have decided to do is search for a line with the string "shared memory segments". But After I find the line I need to see if there are any shared memory ipc's so I need to proceed 2 lines. Then I can ipcrm -m $2 to remove the ipc. Now I need to go to the next line to see if there is another ipc or a blank line. Is this correct?

How can I test for a blank line? Does NR++ put me on the next line?
 
Test for blank line:
Code:
 NF==0
Read the next line:
Code:
 getline
Anyway:
Code:
 man awk

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top