Merge pull request #2240 from DOCGroup/revert-2239-jwi-pi23
[ACE_TAO.git] / ACE / bin / clean_sems.sh
blobb73793c7b62ae086a5c6ad036aef9e13727f3fe5
1 #!/bin/sh
3 SYSTEM=`uname -s`
4 IPCS="ipcs"
5 IPCRM="ipcrm -s"
7 if [ "$SYSTEM" = "Darwin" ]; then
8 USER=`id | sed 's/(.*//; s/uid=//'`
9 IPCS="ngvipc -s"
10 IPCRM="ngvipc -s -R"
11 elif [ -z "$USER" ]; then
12 USER=`id | sed 's/).*//; s/.*(//'`
16 case "$SYSTEM" in
17 "Linux" )
18 ipcs -a | grep $USER | awk '{ print ($2) }' | xargs -r ipcrm sem;
20 * )
21 semids=`$IPCS | grep "^s" | grep $USER | awk '{ print ($2) }'`
22 for p in $semids
23 do $IPCRM $p
24 done
26 esac