Originally Posted by
eva69
Hey
I was wondering if there is a way to use ipcrm to remove multiple shared memory segments or semaphores from a certain owner.
Basically, I have a program that if it ends abruptly, I need to be able to clear out the shared memory segments and semaphores that I make, instead of doing it one by one and manually typing in the IDs of these segments, is there a way I can use ipcrm to simply remove everything from a certain owner? Thanks.
How about:
Code:
ipcs | awk '/$USER/ { print $2 }' | xargs ipcrm
Where $USER is the username in question (WARNING: I believe this should work, but I haven't actually tested it since I don't want to delete any of my SysV resources )