#!/bin/bash

IPCS=`ipcs | egrep "0x[0-9]+ [0-9]+" | cut -f2 -d" "`

for id in $IPCS; do
	ipcrm shm $id;
	ipcrm sem $id;
	ipcrm msg $id;
done