#!/usr/local/bin/tcsh
#

echo Deleting all shared memory segments....
rm -f /tmp/ipcs.tmp
ipcs > /tmp/ipcs.tmp
foreach i ("`cat /tmp/ipcs.tmp`")
	set ipcs_type = `echo $i | cut -c1`
	if ($ipcs_type == 'm') then
     set ipcmd = `echo $i | cut -f1,2 -d" "`
     echo ipcrm -"$ipcmd"
	  ipcrm -`echo $i | cut -f1,2 -d" "`
	else if ($ipcs_type == 's') then
     set ipcmd = `echo $i | cut -f1,2 -d" "`
     echo ipcrm -"$ipcmd"
	  ipcrm -`echo $i | cut -f1,2 -d" "`
	endif
end
rm -f /tmp/ipcs.tmp

