mainThe GNU Bourne-Again SHell - Support: sr #109374, Brace expansion of filenames with...

 
 

sr #109374: Brace expansion of filenames with spaces when in quotes

Submitter:  None
Submitted:  Mon 28 Aug 2017 06:40:35 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  2 - Minor Status:  Invalid
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 18 Sep 2017 03:47:25 PM UTC, comment #1: 

I guess I don't understand why you tried this knowing that quotes inhibit brace expansion:

"A correctly-formed brace expansion must contain unquoted opening
and closing braces, and at least one unquoted comma or a valid
sequence expression."

The behavior has a straightforward explanation: bash performed the requested completion (into braces) and completed the quoted string as it does with every other completion.

The fact that brace expansion doesn't take place when in quotes is not considered when doing what the user requests.

Chet Ramey <chet>
Group administrator
Mon 28 Aug 2017 06:40:35 PM UTC, original submission:  

Say I have two files which have spaces in their names:

$ ls -l
total 0
-rw-r--r-- 1 user user 0 Mar 28 10:00 File Name
-rw-r--r-- 1 user user 0 Mar 28 10:00 File Surname

Now I start typing the 'File ' part and hit M-{ like so:

$ ls 'File<M-{>

Bash completes this this way:

$ ls 'File\ {Name,Surname}'
ls: cannot access 'File\ {Name,Surname}': No such file or directory

The same happens with double quotes "", but it works fine if no quotes are used


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-18 chet StatusNone Invalid

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code