Rawest raw string literals

Jussi Piitulainen jussi.piitulainen at helsinki.fi
Fri Apr 21 01:23:45 EDT 2017


Tim Chase writes:

> A number of tools use a custom quote-string:
>
> Bash:
>
>   cat <<EOT
>   "single and double" with \ and /
>   EOT

[snip]

> PS: yes, bash's does interpolate strings, so you still need to do
> escaping within, but the arbitrary-user-specified-delimiter idea still
> holds.

If you put any quote characters in the initial EOT, it doesn't. Quote
removal on the EOT determines the actual EOT at the end.

  cat <<"EOT"
  Not expanding any $amount here
  EOT



More information about the Python-list mailing list