File: rmshm

package info (click to toggle)
gimp 1.0.0-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 16,832 kB
  • ctags: 16,019
  • sloc: ansic: 225,077; lisp: 8,497; makefile: 4,769; sh: 2,154
file content (16 lines) | stat: -rwxr-xr-x 295 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

user=`whoami`

if test `uname` = "Linux"; then
  shmids=`ipcs -m | grep $user | awk '{ print $1 }'`
  IPCRM="ipcrm shm"
else
  shmids=`ipcs -m | grep $user | awk '{ print $2 }'`
  IPCRM="ipcrm -m"
fi

for id in $shmids; do
  echo removing shared memory segment: $id
  $IPCRM $id
done