Bug 435421

Summary: '\' can not be used to quote all delimiters.
Product: Red Hat Enterprise Linux 5 Reporter: Cai Xianchao <caixianchao>
Component: tcshAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED NOTABUG QA Contact: Bill Huang <bhuang>
Severity: low Docs Contact:
Priority: low    
Version: 5.1   
Target Milestone: rc   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-23 09:28:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
This is a patch fixing the bug. none

Description Cai Xianchao 2008-02-29 08:26:02 UTC
Description of problem:

Version-Release number of selected component (if applicable):
Manpage says that "a‘\’ can be used to quote the delimiter inside l and r." But,
'\' can not be used to quote the delimiter '(', ')', '|' and '>'.

How reproducible:


Steps to Reproduce:
1.[test@RHEL5 ~]$ set test=(ab cd)
2.[test@RHEL5 ~]$ echo $test:s(\(a(A(
Too many ('s.
3.[test@RHEL5 ~]$ echo $test:s)\)a)A)
Too many )'s.
4.[test@RHEL5 ~]$ echo $test:s|\|a|A|
Invalid null command.
5.[test@RHEL5 ~]$ echo $test:s>\>a>A>
Missing name for redirect.
  
Actual results:
The substitution fails and error messages are outputed.

Expected results:
'a' is replaced by 'A'.

Additional info:

Comment 1 Cai Xianchao 2008-02-29 08:26:02 UTC
Created attachment 296314 [details]
This is a patch fixing the bug.

Comment 2 Vitezslav Crhonek 2008-02-29 12:53:08 UTC
Thanks for report and patch!
Fixed in Fedora rawhide.

Comment 3 Vitezslav Crhonek 2008-04-23 09:28:35 UTC
I've reopened the bug.

1.[test@RHEL5 ~]$ set test=(ab cd)
Fine. But note:
[vcrhonek@norcus ~]$ echo $test
ab cd
Braces are not part of variable, they are used because variable contains white
space.
set  var = (str1 str2 str3) define shell variable with value consisting of
multiple strings.

2.[test@RHEL5 ~]$ echo $test:s(\(a(A(
Wrong. There's no "(a" to be replaced with "A".
[vcrhonek@norcus ~]$ echo $test:s(a(A(
Ab cd

3.[test@RHEL5 ~]$ echo $test:s)\)a)A)
Wrong. There's no ")a" to be replaced with "A".
[vcrhonek@norcus ~]$ echo $test:s)a)A)
Ab cd

4.[test@RHEL5 ~]$ echo $test:s|\|a|A|
Wrong. There's no "|a" to be replaced with "A".
[vcrhonek@norcus ~]$ echo $test:s|a|A|
Ab cd

5.[test@RHEL5 ~]$ echo $test:s>\>a>A>
Missing name for redirect.
Wrong. There's no ">a" to be replaced with "A".
[vcrhonek@norcus ~]$ echo $test:s>a>A>
Ab cd

Note this:
[vcrhonek@norcus ~]$ set test = ( ab\> cd )
[vcrhonek@norcus ~]$ !:s(\((X(:p
set test = X ab\> cd )

[vcrhonek@norcus ~]$ set test = ( ab > cd )
[vcrhonek@norcus ~]$ !:s>\>>X>:p
set test = ( ab X cd )

So everything works correctly, changing resolution to NOTABUG and man page will
be fixed back in Fedora.