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

Re: [Feature Request] Adding option to support triple quotes



2019-08-13 10:36:53 +0430, Aryn Starr:
> Adding an option to zsh to support triple quotes
> (TRIPLE_QUOTES) would make possible much more readable code.
[...]

We could also implement mksh's "$(<<'EOF'
arbitrary text that mustn't end in empty lines
EOF
)"

That already works in zsh, but is not optimised like in mksh as
it does "$(cat <<'EOF'
arbitrary text that mustn't end in empty lines
EOF
)" while mksh treats it specially as effectively a kind of
quotes.

mksh also supports $(<<'EOF'
foo
EOF)

(though that's probably not POSIX).

See also perl's q(...) and qq(...) that are more compatible with
the shell syntax than those python '''/""".

See:

$ a="'"; print -r ${(qq)a}
''\'''

-- 
Stephane






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