tech-userlevel archive

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

Re: Empty sub-shells and command groups in /bin/sh

    Date:        Tue, 17 May 2016 16:05:57 +0000 (UTC)
    From: (Christos Zoulas)
    Message-ID:  <nhffh5$m9s$>

  | I think we should probably have "strict posix mode" for this (via an
  | environment variable or command line switch?) ...

That we have already.   (Both variants, and set -o)

  | Allowing relaxed syntax like this is convenient.

Three choices (or maybe 4) - all of it (all places where the old shell
permitted empty commands like "sh -c '&&'" ?   There seems to have been
no fallout at all from changing that one.

All the grouping commands '( )' '{ }' and 'fn() { }' ?

As David Holland suggested, just the '{ }' (and in that case, automatically)
'fn() { }'

Or just for function definitions?   Or perhaps some other combination,
though I suspect those are the most likely ones.

Any are possible, either all the time, or allowing them only in non-posix mode.

Which do you (and everyone else) prefer ?


Home | Main Index | Thread Index | Old Index