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

Re: would it be nice to support =<< ? (not the haskell one)



On Wed, Nov 09, 2016 at 11:27:41AM -0800, Bart Schaefer wrote:
>     element=$(<<.
>         { "user": "$USER", "uid": "$UID" }
>     .
>     )
> 
> This is handled efficiently, with a minimum of forking.

i got it in my mind but i have to admit i always think twice before
using $() for a little amount of data (but i never benchmark anything)

in another hand, i realize i assumed that using read with an heredoc
doesn't need a fork. was i wrong ?

anyway: thanks for the idea!

> Note that it's necessary to follow the end marker with a newline before adding
> the closing paren.

nice to point it out! i wasted hours on things like that when i was a
newbie.

regards
marc



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