#!/bin/ksh
ipcs -m -a | grep -i $(whoami) | grep " 0 " | read f1 f2 f3
while [ ${f2:-"not found"} != "not found" ]
do
  ipcrm -m $f2 | echo "ipcrm -m $f2" 
  ipcs -m -a | grep -i $(whoami) | grep " 0 " | read f1 f2 f3
done
