[tex-live] kpsewhich

Hans Hagen pragma at wxs.nl
Fri Mar 26 17:31:44 CET 2004

Hi Thomas,

> > When using kpsewhich, there is a dependency on the OS
>It is not kpsewhich which causes this, it is the call to execute a shell
>command and the underlying interpreter which causes these differences.

sure, but usage of kpsewhich should be similar on all platforms, i.e. for 
all things that would cause such interpreter dependencies, there should be 

>You could easily wrap the different $ of the shells by wrapping things
>in a quotevar  function, so that you could write
>   kpsewhich -expand-var quotevar('$SELFAUTOPARENT')
> > portable. So, i wonder if it's possible to make kpsewhich in this respect
> > platform independent.
>kpsewhich *is* platform independent. The underlying shells are not...

indeed, which is why i gave the 4 examples

>If you write a C program which calls execl(), you'll see that there is
>no difference in parsing the $.

i'm aware of the differences in shell expansion (and taking care of it in 
the process of keeping scripts multiplatform has messed up many scripts i 
made) -)

the fact that kpsewhich uses this $ and that the $ is a platform related 
feature, makes kpsewhich kind of platform dependent and just as tds aims ar 
being as independent as possible (for instance in putting constraints on 

this is comparable to the & used for format loading in tex: the --fmt 
provides a way out; so either expand-var should accept a NAME or there 
should be something expand-var-assuming-a-dollar-in-front

(this expansion problem is one reason why in most cases i write ruby or 
perl scripts instead of batch or shell scripts -)


More information about the tex-live mailing list