Explanation of strange script behavior sought

Michael T. Davis DAVISM at kcgl1.eng.ohio-state.edu
Fri Apr 14 09:50:13 AEST 1989


	I'm trying to use the script below to determine where on the local
network a particular user is logged onto, if they are logged on at all.  I
can't get it to accept more than one parameter, though.  If I call it "where",
with the execute bit set in the protection mask, I can call it via "where
username1 username2 ...".  However, as I've already stated, it only accepts
the first parameter.  What am I doing wrong, or even better -- is there an
easier way to do what this script does?  Here's the script:

----------------------------------------

#!/bin/csh -f
#
foreach username ( $argv[*] )
    rwho | grep -w $username
end

----------------------------------------

							Thanks,
							 Mike
__________________________________________________________________________
|        THE InterNet address> davism at kcgl1.eng.ohio-state.edu           |
--------------------------------------------------------------------------
|                        These_Thoughts := My_Own                        |
|************************************************************************|
|         "Daddy, Daddy!!  Why's Mommy running across the field?"        |
|                        "Shut up Son, and reload."                      |
--------------------------------------------------------------------------



More information about the Comp.unix.questions mailing list