Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 236900 - impossible to transliterate escaped backslash
impossible to transliterate escaped backslash
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: sed (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Petr Machata
Depends On:
  Show dependency treegraph
Reported: 2007-04-18 07:27 EDT by Josef Kubin
Modified: 2015-05-04 21:33 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-09 00:21:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Fix for RHEL-3 (1.53 KB, patch)
2007-04-18 09:42 EDT, Petr Machata
no flags Details | Diff

  None (edit)
Description Josef Kubin 2007-04-18 07:27:37 EDT
Description of problem:
.qa.[root@i386-3as tps]# echo aka | sed 'y,a,\\,'
sed: -e expression #1, char 7: strings for y command are different lengths

Version-Release number of selected component (if applicable):

How reproducible:
Comment 1 Petr Machata 2007-04-18 09:42:27 EDT
Created attachment 152905 [details]
Fix for RHEL-3

Fix for this problem.

$ locale | grep LANG
$ echo abcd | ./sed-4.0.7/sed/sed 'y,abcd,\\\t\,!,'
\	,!

$ locale | grep LANG
$ echo abcd | ./sed-4.0.7/sed/sed 'y,abcd,\\\t\,!,'
\	,!

Also works the other way around:
$ echo -e '\\\t,!' | ./sed-4.0.7/sed/sed 'y,\\\t\,!,abcd,'
Comment 5 Josef Kubin 2007-04-25 08:19:33 EDT
escaped characters are hopelessly buggy ...

.qa.[root@ia64-3as tps]# echo -e 'ata' | sed 'y,t,\k,'
sed: -e expression #1, char 7: strings for y command are different lengths
.qa.[root@ia64-3as tps]# echo -e 'ata' | sed 'y,t,\x,'
.qa.[root@ia64-3as tps]#
Comment 6 Petr Machata 2007-04-25 09:04:42 EDT
  echo -e 'ata' | sed 'y,t,\x,'
behaves as expected.  \x is "hexadecimal escape", given sane argument:
  $ echo 'xyz' | ./sed-4.0.7/sed/sed 'y/y/\x20/'
  x z
If the argument is not provided, backslash is simply ignored.  This is
consistent with latest upstream. E.g. echo does something similar:
  $ echo -e 'a\x20\x'
  a \x

The \k case is resolved by the attached patch in a manner consistent with
upstream: unresolved escapes are taken as if backslash was not there.
Comment 8 RHEL Product and Program Management 2007-05-09 00:21:02 EDT
Product Management has reviewed and declined this request.  You may appeal this
decision by reopening this request. 

Note You need to log in before you can comment on or make changes to this bug.