Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Escaping shell characters in a string
- X-seq: zsh-users 6554
- From: Michał Politowski <mpol@xxxxxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: Escaping shell characters in a string
- Date: Tue, 9 Sep 2003 19:08:00 +0200
- In-reply-to: <20030909165201.GE6706@.central.sun.com>
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030909165201.GE6706@.central.sun.com>
On Tue, 9 Sep 2003 12:52:02 -0400, Steve Talley wrote:
[...]
> % fred="a [ a * a ? a \ a"
[...]
> That is, given a variable, how can I best escape all of the special
> shell characters within? Is there a variable modifier I can use that
> automatically escapes all special characters?
I believe ${(q)fred} is what you want.
--
Michał Politowski -- mpol@xxxxxxxxxxxxxxxxxxx
Talking has been known to lead to communication if practised carelessly.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author