zsh-users
 help / color / mirror / code / Atom feed
From: Steve Dondley <s@dondley.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "Lawrence Velázquez" <larryv@zsh.org>, "Zsh Users" <zsh-users@zsh.org>
Subject: Re: Is there any possible way to automatically escape characters when executing an alias in zsh?
Date: Sat, 11 Sep 2021 19:33:12 -0400	[thread overview]
Message-ID: <ec7ae2eb894e00a522d1cd343f381ff4@dondley.com> (raw)
In-Reply-To: <CAH+w=7abgV+EbUb6U-0bSyfgPUVQfd_q-9XmKMk=FPd8KVD97g@mail.gmail.com>


> Sorry, why does this produce an error?

Ok, it's not technically producing an error in the shell but it is an 
error with taskwarrior. It doesn't respond properly. Other kinds of 
punctuation will also cause more serious problems and confusion. Like 
'&'.

> % tasn call Tom's friend
> quote>
> 
> Do you use setopt cshjunkiequotes ?

No, not familiar with it. But as mentioned above, quotes aren't the only 
problematic punctuation characters. So I'm not sure that would work.


> PWS's solution is also going to produce this result:
> 
> % tasn call 'double "quotes" here'
> tasn call \'double "quotes" here\'
> 
> which is probably not the desired effect?

I just tried it with taskwarrior. The double quote are stripped out. But 
it's unlikely I'd ever write a task like that. 99% of the time the 
problem I have is with me having to escape (or forgetting to escape), 
parentheses and apostrophes.

> Figuring out which quotes mean something and which ought to be
> re-quoted is not a trivial matter.

True, but I'm not going to let the perfect be then enemy of the pretty 
damn good.


  reply	other threads:[~2021-09-11 23:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-11 18:41 Steve Dondley
2021-09-11 19:00 ` zzapper
2021-09-11 19:16 ` Peter Stephenson
2021-09-11 19:28   ` Peter Stephenson
2021-09-11 20:45     ` Steve Dondley
2021-09-11 20:53       ` Peter Stephenson
2021-09-11 21:01         ` Steve Dondley
2021-09-11 22:39           ` Lawrence Velázquez
2021-09-11 23:15             ` Steve Dondley
2021-09-12  0:23               ` Bart Schaefer
2021-09-12  1:27                 ` Steve Dondley
2021-09-12  2:26                   ` Bart Schaefer
2021-09-12  3:02                     ` Steve Dondley
2021-09-11 23:17             ` Bart Schaefer
2021-09-11 23:33               ` Steve Dondley [this message]
2021-09-12  3:33               ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec7ae2eb894e00a522d1cd343f381ff4@dondley.com \
    --to=s@dondley.com \
    --cc=larryv@zsh.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).