Bug#826214: Bug#913247: Please provide a C implementation of /lib/init/init-d-script

Mert Dirik mertdirik at gmail.com
Sat Dec 1 23:21:15 GMT 2018


On Sat, Dec 1, 2018 at 9:48 PM Thorsten Glaser <t.glaser at tarent.de> wrote:
>
> On Sat, 1 Dec 2018, Dmitry Bogatov wrote:
>
> > AFAIK, in shell [ "${foo}" ] is equal to [ -n "${foo}" ].
>
> Not always / portably.
>
>
> I recommend
>
>         test -n "$foo"
>
> for POSIX (which is equivalent to [ -n "$foo" ] but better legible and
> making it clear that test is an external command, not a language con‐
> struct), and
>
>         [[ $foo ]]
>
> for Korn shell and compatibles, including (here) GNU bash.
>
> bye,
> //mirabilos (mksh developer)
> --
> 15:41⎜<Lo-lan-do:#fusionforge> Somebody write a testsuite for helloworld :-)

Thank you Dmitry and Thorsten reviews and suggestions.

This needs to run under both dash and bash, also other lines in the
file are using [ so it'd be better not using a different style than
the rest.



More information about the Pkg-systemd-maintainers mailing list