groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNUism in groff tests


From: Ralph Corderoy
Subject: Re: GNUism in groff tests
Date: Mon, 30 Dec 2019 17:30:29 +0000

Hi Ingo,

>  - The lone "'" inside the here document inside $() results in
>    ./src/roff/groff/tests/on-latin1-device-oq-is-0x27.sh[36]: no closing quote
>    with ksh.

I think that's a ksh bug.  https://manned.org/ksh.1 can be searched for
`<<' and the entry doesn't suggest quote needs escaping.

Heirloom sh is happy with it if I replace $() with ``.  That's a handy
unalduterated shell.  I don't think POSIX states the single quote
requires escaping.
https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_07_04

> So much quoting and escaping is hard to read either way.

I think the printf method can be improved.

> -actual=$("$groff" -Tlatin1 <<EOF
> -.pl 1v
> -\[oq] = '
> -EOF
> -)
> +actual=$(printf ".pl 1v\n\\\\[oq] = '\n" | "$groff" -Tlatin1)

    $ printf ".pl 1v\n\\\\[oq] = '\n"
    .pl 1v
    \[oq] = '
    $ printf ".pl 1v\n\\\\[oq] = '\n" | sha1sum
    86c0cab47574a3b6ee5a89d9472d1751ff6f97dc  -
    $ printf '%s\n' '.pl 1v' '\[oq] = '\' | sha1sum
    86c0cab47574a3b6ee5a89d9472d1751ff6f97dc  -

>  - The <() syntax looks like a GNUism to me.

It isn't Bourne shell.

-- 
Cheers, Ralph.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]