Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000987 [1003.1(2013)/Issue7+TC1] Shell and Utilities Comment Enhancement Request 2015-10-08 03:05 2016-07-14 15:18
Reporter dannyniu View Status public  
Assigned To
Priority normal Resolution Rejected  
Status Closed  
Name DannyNiu/NJF
Organization
User Reference
Section 2.2.3 Quoting
Page Number 2320
Line Number 73612-73616
Interp Status ---
Final Accepted Text
Summary 0000987: Add example for quoting within command substitution within double-quotes.
Description I ran into some difficulty using command substitution to obtain filenames for a command to execute, mainly because of the <space> characters in the filenames.

So I sought to quote them, but in my $(cmd), there's also quoting. I thought I had to use backslash inside, which was ugly. But turns out, `$' has special meaning in double quotes, so I didn't have to quote it again.

So I think an example would do a better job explaining this feature.
Desired Action Add the following informative text to the end of the section.

When the <double-quote> character is needed within a double-quoted string, it should be escaped by a <backslash> character.

example: foo="my name is \"bar\""

However, since characters enclosed in command substitutions are not affected by double quotes, <double-quote> characters within command substitutions within double-quoted strings do not need to be escaped.

example: myvar="quoted $(command "substitution example")"
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0002859)
Don Cragun (manager)
2015-10-08 03:43

The quoting rules for strings inside the $(...) form of command substitution are clearly stated on P2320, L73612-73616 and the Rationale for this section XRAT C.2.2, on P3677, L125674-125685 already contains examples showing how quoting works inside the $(...) form of command substitutions.

- Issue History
Date Modified Username Field Change
2015-10-08 03:05 dannyniu New Issue
2015-10-08 03:05 dannyniu Name => DannyNiu/NJF
2015-10-08 03:05 dannyniu Section => "Shell & Utilities" >> "Shell Command Language" >> "Quoting"
2015-10-08 03:05 dannyniu Page Number => new
2015-10-08 03:05 dannyniu Line Number => new
2015-10-08 03:29 Don Cragun Project 2008-TC2 => 1003.1(2013)/Issue7+TC1
2015-10-08 03:43 Don Cragun Section "Shell & Utilities" >> "Shell Command Language" >> "Quoting" => 2.2.3 Quoting
2015-10-08 03:43 Don Cragun Page Number new => 2320
2015-10-08 03:43 Don Cragun Line Number new => 73612-73616
2015-10-08 03:43 Don Cragun Interp Status => ---
2015-10-08 03:43 Don Cragun Note Added: 0002859
2016-07-14 15:18 geoffclare Status New => Closed
2016-07-14 15:18 geoffclare Resolution Open => Rejected


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker