home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 4.0 PR1
/
NeXT_NEXTSTEP_4.0_PR1_(beta).rar
/
Openstep4-Pr1User.iso
/
usr
/
ucb
/
which
< prev
next >
Wrap
Text File
|
1995-09-02
|
758b
|
46 lines
#!/bin/csh -f
set prompt = "% "
if ( -f ~/.cshrc) then
source ~/.cshrc
endif
set noglob
foreach arg ( $argv )
set alius = `alias $arg`
switch ( $#alius )
case 0 :
breaksw
case 1 :
set arg = $alius[1]
breaksw
default :
echo ${arg}: " " aliased to $alius
continue
endsw
unset found
if ( $arg:h != $arg:t ) then
if ( -e $arg ) then
echo $arg
else
echo $arg not found
endif
continue
else
foreach i ( $path )
if ( -x $i/$arg && ! -d $i/$arg ) then
echo $i/$arg
set found
break
endif
if ( -d $i/$arg.app && -x $i/$arg.app/$arg ) then
echo $i/$arg.app/$arg
set found
break
endif
end
endif
if ( ! $?found ) then
echo no $arg in $path
endif
end