Blob Blame History Raw
#!/bin/sh
# Motif
#
# Copyright (c) 1987-2012, The Open Group. All rights reserved.
#
# These libraries and programs are free software; you can
# redistribute them and/or modify them under the terms of the GNU
# Lesser General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# These libraries and programs are distributed in the hope that
# they will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with these librararies and programs; if not, write
# to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
# Floor, Boston, MA 02110-1301 USA
#
# HISTORY

#
#	Script to reproduce PIR 2793
#
#	To run this program type 'nohup behavior_test'
#
#	Related files forthis test are:
#	
#		./behavior.xinit
#		./behavior.Xdefs
#		./behavior.mwmrc
#

SYSTEM=`uname -a | awk -F' ' '{print $1}'`
CURR_DIR=`pwd`
XENVIRONMENT=`pwd`

# get the xinit process and kill it
#	look for " xinit" or ".../xinit"
#	this should give you only things that really are xinit
#	remove all leading whitespace and replace multiple
#	tabs/spaces with 1 space
if [ ${SYSTEM} = "HP-UX" ]
then
# HP version
	X_LINE=`ps -ef | grep X | egrep -v "xinit|grep"`
	BETTER_X_LINE=`echo ${X_LINE} | sed -e 's/^[	 ]*//
		s/[	 ][	 ]*/ /g'`
	X_PID=`echo ${BETTER_X_LINE} | cut -d' ' -f2`
else
# others, like DEC version
    X_LINE=`ps -axw | grep X | egrep -v "xinit|grep"`
	BETTER_X_LINE=`echo ${X_LINE} | sed -e 's/^[   ]*//
		s/[  ][  ]*/ /g'`
	X_PID=`echo ${BETTER_X_LINE} | cut -d' ' -f1`
fi

	kill ${X_PID}
# start new X session
	sleep 5
#
xinit ${CURR_DIR}/behavior.xinit
# end of script