#!/bin/csh
#!/bin/csh -xv
#Program by G Wildenberg to test if a given account is logged in.
if { ( w -h | grep $1 >& /dev/null ) } then
	echo "$1" is logged in
else
	echo "$1" is NOT logged in
endif

#Now use the ! to negate
if ! { ( w -h | grep $1 >& /dev/null ) } then
	echo "$1" is NOT logged in
else
	echo "$1" is logged in
endif
