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

Re: The elements of enlightenment



On Tue, Dec 6, 2022, at 1:55 PM, Roman Perepelitsa wrote:
> That said, it's totally possible to extend zsh with something like $[
> ... ] which would work like $( ... ) but without forking. It would run
> the commands in another thread within the same process.

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.)

-- 
vq




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