GNU bug report logs - #38082
'tr' question passing tr delete chars argument coded in hex into script as $varable

Previous Next

Package: coreutils;

Reported by: Owen Townsend <owen <at> uvsoftware.ca>

Date: Wed, 6 Nov 2019 01:21:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Owen Townsend <owen <at> uvsoftware.ca>
To: 38082 <at> debbugs.gnu.org
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
[Message part 1 (text/plain, inline)]
To: bug-coreutils.org
From: Owen Townsend, owen <at> uvsoftware.ca
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

[renameLNX (text/plain, attachment)]
[renameLNX1 (text/plain, attachment)]

This bug report was last modified 5 years and 313 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.