From: Robert Klemme Date: 2004-10-06T00:49:55+09:00 Subject: Re: env question schrieb im Newsbeitrag news:Pine.LNX.4.60.0410050843500.7297@harp.ngdc.noaa.gov... > On Tue, 5 Oct 2004, Robert Klemme wrote: > > > Sure enough. But what's the advantage over > > > > #!ruby > > > > Are there shells that don't allow this? > > > jib:~ > for shell in tcsh csh sh bash ksh;do echo $shell; $shell -c ../a.rb;done > tcsh > ./a.rb: Command not found. > csh > ./a.rb: Command not found. > sh > sh: ./a.rb: ruby: bad interpreter: No such file or directory > bash > bash: ./a.rb: ruby: bad interpreter: No such file or directory > ksh > ksh: ./a.rb: No such file or directory > > does that work for you - if so what os/shell? 17:46:28 [ruby]: for sh in `cat /etc/shells` ; do echo $sh; $sh -c ./a.rb; done /bin/sh yes! /bin/bash yes! /bin/ksh yes! /bin/pdksh yes! /bin/tcsh yes! /bin/zsh yes! /usr/bin/sh yes! /usr/bin/bash yes! /usr/bin/ksh yes! /usr/bin/pdksh yes! /usr/bin/tcsh yes! /usr/bin/zsh yes! 17:46:48 [ruby]: cat ./a.rb #!ruby puts "yes!" 17:46:56 [ruby]: uname -a CYGWIN_NT-5.0 bond 1.5.10(0.116/4/2) 2004-05-25 22:07 i686 unknown unknown Cygwin I'll check on my debian when I'm at home. > > Does env search not only $PATH but elsewhere? > > AFAIK it searches only in $PATH. Ok, that's what I thought. Kind regards robert