tags:

views:

203

answers:

1

I knew that IPCRM is used to clean hanging IPCS and semaphores for a particumar user by passing the segment id or the semaphore id in either -m or -s option. WE NEED TO PASS INDIVIDUAL SEGMENT ID/ SEMAPHORE ID IN -m OPTION. Is there any way to clean ipcs that belongs to a particular user in just one move.

I think shell script could be the way but not sure. Please help

A: 

Give something like this a try:

ipcs -s | awk '$1=="s" && $5=="daveshawley" {print "-s",$2}' | xargs ipcrm

You will probably want to substitute the user's real name for mine of course. You might want to try this question over on http://superuser.com/ as well

D.Shawley