Created
May 20, 2013 01:57
-
-
Save oliverdaff/5609983 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ME=`whoami` | |
PROCESS=$1 | |
echo $PROCESS | |
echo $ME | |
IPCS_S=`ipcs -s $PROCESS | egrep "0x[0-9a-f]+0-9]+" | grep $ME | cut -f2 -d" "` | |
IPCS_M=`ipcs -m $PROCESS | egrep "0x[0-9a-f]+[0-9]+" | grep $ME | cut -f2 -d" "` | |
IPCS_Q=`ipcs -q $PROCESS | egrep "0x[0-9a-f]+[0-9]+" | grep $ME | cut -f2 -d" "` | |
echo $IPCS_S | |
echo $IPCS_M | |
echo $IPCS_Q | |
#ipcs -m $PROCESS | egrep "0x[0-9a-f]+[0-9]+" | |
for id in $IPCS_M; do | |
ipcrm -m $id; | |
done | |
for id in $IPCS_S; do | |
ipcrm -s $id; | |
done | |
for id in $IPCS_Q; do | |
ipcrm -q $id; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment