From: Martijn Dekker <martijn@inlv.org>
To: zsh-users@zsh.org
Subject: Re: Please help me quote ! :)
Date: Mon, 26 Feb 2018 20:36:19 +0000 [thread overview]
Message-ID: <835f7747-73fe-44c7-8106-5d480f943879@inlv.org> (raw)
In-Reply-To: <20180226175037.hgrrnft44wjx3so7@solfire>
Op 26-02-18 om 17:50 schreef tuxic@posteo.de:
> is there a way to automatically escape all "bad" characters
> (like spaces) while expanding a shell variable containing a
> "bad" filename?
Yes. See 'man zshexpn' under the heading "Parameter Expansion Flags".
The flag you need is the "q" flag. For instance, instead of $var, use
${(q)var}. See the man page for how to tweak the quoting format.
HTH,
- M.
next prev parent reply other threads:[~2018-02-26 20:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-26 17:50 tuxic
2018-02-26 20:36 ` Martijn Dekker [this message]
2018-02-26 20:37 ` Peter Stephenson
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=835f7747-73fe-44c7-8106-5d480f943879@inlv.org \
--to=martijn@inlv.org \
--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).