Discussion:
[tex-k] kpsewhich --var-value
jfbu
2015-05-01 17:50:44 UTC
Permalink
Hi,

the kpathsea manual says

http://tug.org/texinfohtml/kpathsea.html#Auxiliary-tasks

• ‘--var-value=variable’ outputs the value of variable, expanding ‘$’ (see Variable expansion and ‘~’ (see Tilde expansion) constructs, but not performing other expansions.

but:

$ env TEXMFHOME="/tmp" kpsewhich --var-value '$TEXMFHOME'

$ env TEXMFHOME="/tmp" kpsewhich --var-value TEXMFHOME
/tmp

This is a bash shell

Do I do something wrong ?

$ export TEXMFHOME="/tmp"
$ kpsewhich -var-value TEXMFHOME
/tmp
$ kpsewhich -var-value '$TEXMFHOME'

$

Perhaps it is to be understood that if a texmf.cnf defines a variable then if this variable is queried, $ and ~ therein will be expanded ?

I tried something else:

$ export TMP1='$TMP2'
$ export TMP2='~'
$ kpsewhich -var-value '$TMP1'

$ kpsewhich -var-value '$TMP2'

$

regards,

Jean-François
jfbu
2015-05-01 17:58:58 UTC
Permalink
Post by jfbu
Hi,
the kpathsea manual says
http://tug.org/texinfohtml/kpathsea.html#Auxiliary-tasks
• ‘--var-value=variable’ outputs the value of variable, expanding ‘$’ (see Variable expansion and ‘~’ (see Tilde expansion) constructs, but not performing other expansions.
$ env TEXMFHOME="/tmp" kpsewhich --var-value '$TEXMFHOME'
$ env TEXMFHOME="/tmp" kpsewhich --var-value TEXMFHOME
/tmp
This is a bash shell
Do I do something wrong ?
$ export TEXMFHOME="/tmp"
$ kpsewhich -var-value TEXMFHOME
/tmp
$ kpsewhich -var-value '$TEXMFHOME'
$
Perhaps it is to be understood that if a texmf.cnf defines a variable then if this variable is queried, $ and ~ therein will be expanded ?
sorry for the noise. I understand

$ export TMP1='$TEXMFHOME'
$ kpsewhich -var-value TMP1
/Users/---/Library/texmf
$

I find the formulation of the manual a bit confusing, though.

regards

Jean-François

Loading...