[OS X TeX] can't find files in /usr/local/tetex/bin/

Justin Walker justin at mac.com
Fri Apr 9 02:13:51 CEST 2004


On Apr 8, 2004, at 17:06, Stefan Walsen wrote:

> Justin Walker wrote:
>> On Apr 8, 2004, at 12:56, Jan Anderssen wrote:
>>> - another way to tell which shell you're in: 'echo $SHELL'
>> This isn't really reliable; for example, if you log in to tcsh, and 
>> run bash, $SHELL will be /bin/tcsh.  I don't know what the effect of 
>> running a 'bash' shell script from tcsh would be, for example.
>
> That depends on several things:

Amen.

> If the first line is "#!/bin/bash", it'll be run by bash and 
> everything will work fine.

That is true; what I was pointing out is that you (or, at least, I) 
don't know that, within the environment where that shell script is 
executing, the variable SHELL will be set to '/bin/bash', or perhaps, 
the environment inherits the setting of SHELL from the shell that 
invoked the shell script in the first place.

My main point is that trying to nail down the shell that you are 
executing under is tricky.  Relying on SHELL is probably not a good 
thing.  I don't, however, have a definitive answer.

> If that's not the case, you can also call it by typing
>  "bash <scriptname>".
>
> What won't work is if the script does not start with a line similar to 
> the one above but is executable and you call it directly, or 
> (regardless whether it's executable or not) you call it by typing
> "source <scriptname>", because that will result in tcsh's comand 
> interpreter being used.
>
> How to get the name of the current shell:
> echo $0
> should do the trick.

'bash' and 'tcsh' often masquerade as 'sh' and 'csh', respectively, so 
this check isn't definitive either.

Cheers,

Justin

--
Justin C. Walker, Curmudgeon-At-Large  *
Institute for General Semantics        |    Men are from Earth.
                                        |    Women are from Earth.
                                        |       Deal with it.
*--------------------------------------*-------------------------------*

-----------------------------------------------------
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the macostex-archives mailing list