6 lines
250 B
TeX
6 lines
250 B
TeX
% \GetEnv[\HOME]{HOME} % Example: Store $HOME shell var into \HOME cmd.
|
|
\usepackage{catchfile}
|
|
\newcommand{\GetEnv}[2][]{%
|
|
\CatchFileEdef{\Temp}{"|kpsewhich --var-value #2"}{\endlinechar=-1}%
|
|
\if\relax\detokenize{#1}\relax\Temp\else\let#1\Temp\fi}
|