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

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



Aryn Starr wrote on Thu, 15 Aug 2019 14:29 +00:00:
> That EOF solution is good if there is a lot of text, but for short 
> snippets, it’s too many characters to type. Completely against the 
> shell’s spirit of arcane brevity. :))
> I also thought of a (kind of) new application for the triple quotes. I 
> think it’ll enable a lot more functions like this:
> cc() python -c "from math import *; print($*);"
> Since we’ll be able to easily write the target language’s code in our 
> shell, with minimal typing.

I don't really understand your example, but I did want to point out this:

[[[
#!/usr/bin/env zsh
: '''.'; /sbin/shutdown -h now; : '.'''
]]]

With TRIPLE_QUOTES, it's harmless.  If TRIPLE_QUOTES is unset or doesn't
exist (older version of zsh), it executes an external command.  (Just
imagine it said «rm -rf /» there.)



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