ipcs | grep apache | awk '{print $2}' > sem.txt
for i in `cat sem.txt`; do { ipcrm -s $i; }; done;

Or, as there is no space left (sorta) for sem.txt

for i in `ipcs|grep 'apache'|awk '{print $2}'`; do ipcrm -s $i; done


This thread for sale. Click here! [Linked Image from navaho.infopop.cc]