开发者

Cleaning hanging IPCS in UNIX

I knew that IPCRM is used to clean hanging IPCS and semaphores for a particumar user by passing the segment id or the se开发者_StackOverflowmaphore 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜