Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: The elements of enlightenment



On Tue, Dec 6, 2022, at 6:52 PM, Lawrence Velázquez wrote:
> FWIW, ksh has a ${ list;} construct that avoids a subshell:
>
> 	$ cd / && pwd
> 	/
> 	$ : "${ cd /tmp;}" && pwd
> 	/tmp
> 	$ : "${ cd /usr }" && pwd
> 	/usr
>
> Amusingly, the archaic $[...] is still used for arithmetic expansion.
> It's even documented!  (Other shells have memory-holed it.)

To clarify my sloppy editing:  The last paragraph is about zsh.
Other shells also support legacy $[...] but pretend it doesn't
exist.

-- 
vq




Messages sorted by: Reverse Date, Date, Thread, Author