On Thu, May 23, 2024 at 2:49 AM Steffen Nurpmeso <stef...@sdaoden.eu> wrote:
> Only to note that this is not portable.
> The FreeBSD shell will not assign "b" to "c" for this one!

Nor will NetBSD sh. This lets you swap values of two variables without
using a third

$ x=1 y=2
$ x=$y y=$x
$ echo $x $y
2 1

And some Bourne shells expand command substitutions first

$ (exit 5)
$ x=$? y=`exit 10`
$ echo $x
10

Reply via email to