help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Transform strings with special characters so that the st


From: Chet Ramey
Subject: Re: [Help-bash] Transform strings with special characters so that the strings don't need to be quoted?
Date: Thu, 26 Mar 2015 08:56:55 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/25/15 5:42 PM, Eric Blake wrote:
> On 03/25/2015 03:26 PM, Eric Blake wrote:
> 
>>>> printf -v escaped_var %q "$var"
>> 
>> Fork-free.
> 
> But requires bash extensions ('printf -v var' and 'printf %q' are
> both bashisms not likely to work in other shells)

It's help-bash, after all.  I don't think people mind bash solutions.

- -- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)

iEYEARECAAYFAlUUAhcACgkQu1hp8GTqdKvesQCgkp9fypiGAd3NemeIbSPzCbdj
IIAAn29U9m1yMeXHtLP3+s+uiE79JWbf
=u2+b
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]