3 # $Header: shmkill,v 2.0 88/06/05 00:16:59 root Exp $
5 # A script to call from crontab periodically when people are leaving shared
6 # memory sitting around unattached.
8 open(ipcs,'ipcs -m -o|') || die "Can't run ipcs";
11 $tmp = index($_,'NATTCH');
12 $pos = $tmp if $tmp >= 0;
14 ($m,$id,$key,$mode,$owner,$group,$attach) = split;
15 if ($attach != substr($_,$pos,6)) {
16 die "Different ipcs format--can't parse!";
19 push(@goners,'-m',$id);
24 exec 'ipcrm', @goners if $#goners >= 0;