#!/bin/csh
#	@(#)vasclean	1.2	8/12/92
#
#
#     $Id: vasclean,v 1.1 1998/03/16 20:03:03 avvede Exp $
#     $Log: vasclean,v $
#     Revision 1.1  1998/03/16 20:03:03  avvede
#     Initial move to CVS
#
#
#
#
#	Copyright (c) 1986, 1987, 1988 by
#	Periphonics Corporation
#	4000 Veterans Memorial Highway
#	Bohemia
#	NY 11716
#
#	This software is furnished under a license and may be used and
#	copied only in accordance with the terms of such license and with
#	the inclusion of the above copyright notice. This software or any
#	other copies thereof, may not be provided or otherwise made available
#	to anyone other than the licensee. Title to and ownership of this
#	software remains with the Periphonics Corporation.
#
#	The information in this document is subject to change without notice
#	and should not be construed as a commitment by Periphonics.
#
#	Periphonics assumes no responsibility for the use or reliability of
#	its software on equipment that is not supplied by Periphonics.
#
#	File Name:
#		makeapp
#
#	Description:
#		Procedure to produve VRAM applications.
#		See usage line below.
#
#	Change				Reason
#	No.	Date		Name	for Change
#
#	0	19-mar-92	lmg	Original.
#	1	12-aug-92	lmg	Removed ipcs command.
#
#
#	check argument count
#
if ($#argv != 1) then
	echo "usage: vasclean {msg|sm|sem}"
	exit 1
endif
#
# What to clean
#
if ( $1 == "msg" ) then
	ipcs -q | egrep -v "status|ID|Message" | awk '{ print "ipcrm -q " $2}' | sh
else
	if ( $1 == "sm" ) then
		ipcs -m | egrep -v "status|ID|Memory" | awk '{ print "ipcrm -m " $2}' | sh
	else
		if ( $1 == "sem" ) then
			ipcs -s | egrep -v "status|ID|Semaphores" | awk '{ print "ipcrm -s " $2}' | sh
		else
			echo "usage: vasclean {msg|sm}"
			exit 1
		endif
	endif
endif

