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


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

Submitted by:  None
Submitted on:  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

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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>
Project 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



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

Attach Files:

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)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    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.4