File: cleanipcs

package info (click to toggle)
mpich 1.1.0-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 22,116 kB
  • ctags: 27,349
  • sloc: ansic: 193,435; sh: 11,172; fortran: 6,545; makefile: 5,801; cpp: 5,020; tcl: 3,548; asm: 3,536; csh: 1,079; java: 614; perl: 183; awk: 168; sed: 70; f90: 62
file content (26 lines) | stat: -rwxr-xr-x 491 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/sh
# courtesy of Jarek Nieplocha, to clean ipc's
# Modified by Bill Gropp to apply only to calling user
ipccmd=ipcrm
for arg in "$@" ; do
   case $arg in
	-help|-u|-us*|-h)
	echo "cleanipcs [-show] [-echo]"
	exit 1
	;;
	-echo)
	set -x
	;;
	-show)
	ipccmd=echo
	;;
	*)
	if [ -n "$arg" ] ; then
  	    echo "Unrecognized argument $arg"
	    exit 1
	fi
	;;
   esac
done
#
$ipccmd `ipcs | awk '{if ((($1 == "m") || ($1 == "s")) && ($5 == "'$LOGNAME'")) print sprintf("-%s %s",$1,$2) }'`