[tex-live] how robustly call awk script?

Hartmut Henkel hartmut_henkel at gmx.de
Sun Jan 14 18:23:14 CET 2007


Hi Sanjoy,

On Sun, 14 Jan 2007, Sanjoy Mahajan wrote:

> > ...to answer myself, found a shell wrapper in Nelson Beebe's book. Sorry
> > for the noise, thanks for help.
>
> You probably found the same solution, but for the sake of the
> archives, one method is this magic first line:
>
> #!/usr/bin/env awk -f

thanks a lot for the hint, i tried it also, but alas, it doesn't work:

hahe at hahepc1:~/x-tp$ which env
/usr/bin/env

hahe at hahepc1:~/x-tp$ head /usr/local/bin/tpic2pdftex_
#!/usr/bin/env awk -f

(the rest of the file is the AWK program, unquoted)

hahe at hahepc1:~/x-tp$ make
pic -z -t example.pic > example.tpic
tpic2pdftex_ example.tpic > example.tex
/usr/bin/env: awk -f: Datei oder Verzeichnis nicht gefunden

No idea what i have to learn from this last message. Do you have any?

Instead i did it now like this (from Nelson's book):


#!/bin/sh -
AWK=${AWK:-gawk}
export LANG="C"

AWKPROG='
(here goes the awk code)
'

$AWK "$AWKPROG" "$@"


Regards, Hartmut


More information about the tex-live mailing list