[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
utmac -muh error on Ubuntu
From: |
Valtteri Vuorikoski |
Subject: |
utmac -muh error on Ubuntu |
Date: |
Sun, 04 Jul 2021 22:50:37 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2.50 (gnu/linux) |
I was trying out the utmac package today on an Ubuntu system with latest
neatroff. While -mul works fine and produces nice output, -muh
causes the following errors:
sh: 1: Bad substitution
neatroff: failed to open </tmp/tmpl-ul.tr-head.tr>
rm: cannot remove '/tmp/tmpl-ul.tr-head.tr': No such file or directory
This is caused by this line in uh.tmac:
. sy str="\\$2" && echo ".ds head-str ${str: -1}" >
/tmp/\\*[data-file]-head.tr
neatroff invokes system() which passes the command string to /bin/sh,
which on Debian-based distributions is dash, which apparently doesn't
support ${str: -1} style substitutions.
I'm not sure what's the best fix here. Since it's not easily possible to
change what system() does, perhaps the substitution should be replaced
by some kind of pipeline?
I'm no troff expert, but maybe it would be safer to also use .co> to
stash $2 into a temporary file to avoid shell quoting issues?
-Valtteri
- utmac -muh error on Ubuntu,
Valtteri Vuorikoski <=
- Re: utmac -muh error on Ubuntu, John Ankarström, 2021/07/04
- Re: utmac -muh error on Ubuntu, Tadziu Hoffmann, 2021/07/05
- Re: utmac -muh error on Ubuntu, John Ankarström, 2021/07/06
- Re: utmac -muh error on Ubuntu, John Ankarström, 2021/07/06
- Re: utmac -muh error on Ubuntu, Valtteri Vuorikoski, 2021/07/07
- Re: utmac -muh error on Ubuntu, John Ankarström, 2021/07/07
- Re: utmac -muh error on Ubuntu, address@hidden, 2021/07/09