Re: [Help-bash] How to assign special characters like $'\002' to a varia
From:
Quentin L'Hours
Subject:
Re: [Help-bash] How to assign special characters like $'\002' to a variable?
Date:
Tue, 5 Feb 2019 17:41:26 -0800
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
On 2019-02-05 05:33 PM, Peng Yu wrote:
> I am not able to assign special characters like $'\002' to a variable.
> Why is it so? Is there any walk-around? Thanks.
It's there, it's just not printable:
$ declare -p x
declare -- x=""
$ declare -p x | cat -v
declare -- x="^B"
--
Quentin