#!/bin/sh
#
#  title:	rmshm
#  author:	Spencer Kimball
#
#  This script remove all shared memory segments from the system.
#

IPCS="ipcs -m"
IPCRM="ipcrm -m"

shared_mem_ids=`$IPCS | sed 1,3d | awk '{print $2}'`

echo Removing shared memory segments: 
for id in $shared_mem_ids ; do
  echo -n "$id "
  $IPCRM $id
done
