On Mon, Jul 3, 2023, 14:41 Robert Elz <k...@munnari.oz.au> wrote: > Date: Sun, 2 Jul 2023 21:04:38 -0400 > From: Greg Wooledge <g...@wooledge.org> > Message-ID: <zkiepsrizkqze...@wooledge.org> > > | The first assignment is done before the value of "m" is used in the > second > | assignment. > > Note that that is a shell specific feature, applies to bash, but > not necessarily to other shells (some will do it that way, others won't). > > | This feature is commonly used in the following constructs: > | extract=${input#*<} extract=${extract%>*} > | data=$(cat file; printf x) data=${data%x} > > which would be made truly portable if written > > extract=${input#*<}; extract=${extract%>*} > data=$(cat file; printf x); data=${data%x} > > Is there really that much to be gained by omitting a semicolon > in a sequence like that? The only time it matters if if the > assignments in question are prefixes to some other command. Rather > than relying upon that kind of non-portable construct, you'd be better > to restructure the code, and avoid the issue, but this is very rare > except when someone is deliberately trying to make things non-portable. >
i chain assignments , have impression its faster kre > > >