groff
[Top][All Lists]
Advanced

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

Re: [groff] 1.22.4.rc4 - Final RC before official 1.22.4


From: Ralph Corderoy
Subject: Re: [groff] 1.22.4.rc4 - Final RC before official 1.22.4
Date: Sun, 09 Dec 2018 10:36:25 +0000

Hi Ingo,

> Ouch.  My first attempt to fix this with "test -n" failed miserably:
>
>   [...]
>   if test -n ""; then \
>     for f in ; do \
>       cp -f $f /home/schwarze/Local9/share/man/man5/g`basename $f`; \
>     done; \
>   fi
>   bash: -c: line 2: syntax error near unexpected token `;'

The time-honoured way to achieve this is using the built-in `set'.

    $ l='foo bar xyzzy'
    $ set -- $l; for f; do echo f=$f; done | fmt
    f=foo f=bar f=xyzzy
    $ 
    $ l='foo bar'
    $ set -- $l; for f; do echo f=$f; done | fmt
    f=foo f=bar
    $ 
    $ l='foo'
    $ set -- $l; for f; do echo f=$f; done | fmt
    f=foo
    $ 
    $ l=
    $ set -- $l; for f; do echo f=$f; done | fmt
    $ set -- $l; for f; do echo f=$f; done | wc -c
    0
    $ 

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

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