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: Steffen Nurpmeso
Subject: Re: [groff] 1.22.4.rc4 - Final RC before official 1.22.4
Date: Mon, 10 Dec 2018 14:35:29 +0100
User-agent: s-nail v14.9.11-91-g307cc8c8-dirty

Ingo Schwarze wrote in <address@hidden>:
  ..
 |Ralph Corderoy wrote on Sun, Dec 09, 2018 at 10:36:25AM +0000:
 ..
 |> 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=
 |>     $ set -- $l; for f; do echo f=$f; done | fmt
 |>     $ set -- $l; for f; do echo f=$f; done | wc -c
 |>     0
 |>     $ 
 |
 |Good point, indeed i wasn't aware of that technique.
 |Arguably, using it is less intrusive than deleting the very likely
 |usused variables.

Note "for x; do" is new in current POSIX.  It needs to be

  for f
  do
    ddd

instead if portability is an issue.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



reply via email to

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