bug-coreutils
[Top][All Lists]
Advanced

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

bug#38082: 'tr' question passing tr delete chars argument coded in hex i


From: Owen Townsend
Subject: bug#38082: 'tr' question passing tr delete chars argument coded in hex into script as $varable
Date: Tue, 5 Nov 2019 17:07:41 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

To: bug-coreutils.org
From: Owen Townsend, address@hidden
Date: Nov.05/2019
Subject: 'tr' question passing tr delete chars argument coded in hex into script as $varable

I am attaching 2 scripts renameLNX & renameLNX1
renameLNX  - delete characters hard-coded on tr - works OK
renameLNX1 - delete characters passed as $variable from cmdline argument - does not work
           - is this a bug OR is something wrong with my coding ???

renameLNX1 dirxx '\x20\x21\x27\x28\x29\x2C'  #<-- passing hex delete chars cmdline argument
fn2=$(echo $fn1 | tr -d $"$chars")           #<-- does not work
See test results coded as #comments at end of attached renameLNX1 script

fn2=$(echo $fn1 | tr -d $'\x21\x24\x26\x27\x28\x29\x2A\x2C') #<-- hard-coded hex deletes OK
See script renameLNX OK

Is this a bug OR is something wrong with my coding ???
Thanks, Owen

Attachment: renameLNX
Description: Text document

Attachment: renameLNX1
Description: Text document


reply via email to

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