Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Working with Binary Numbers

by blokhead (Monsignor)
on Sep 25, 2007 at 14:30 UTC ( [id://640950]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Working with Binary Numbers
in thread Working with Binary Numbers

This rule does not apply to {x,y,z} alternations in the glob pattern. The documentation I could find isn't great on this point, and its language is generally in terms of filenames. But I'm 99% sure it's not a bug. I've seen tons of uses of glob in this way on PM!

BTW, the same behavior should happen in your shell (though it may be a different glob under the hood).

$ ls {x,y,z} ls: x: No such file or directory ls: y: No such file or directory ls: z: No such file or directory
First, glob expands {...} and then it checks the filesystem to expand * and ? and the resulting pattern(s).
$ ls *{p,q,r} ls: *p: No such file or directory ls: *q: No such file or directory ls: *r: No such file or directory

blokhead

Replies are listed 'Best First'.
Re^4: Working with Binary Numbers
by salva (Canon) on Sep 25, 2007 at 14:50 UTC
    That's what bash docs says about the matter:

      Just to be clearer, if you read the first two sentences of the long section you quoted, it answers your original concern:

      Brace expansion is a mechanism by which arbitrary strings may be generated. This mechanism is similar to pathname expansion, but the filenames generated need not exist.

      So, no, this is not a bug.

      - tye        

      If bash had any bearing in the matter — glob is based on csh's expansion mechanism — it seems to me you just disproved yourself. "the filenames generated need not exist."

        it seems to me you just disproved yourself.

        yes, that was my intention :-)

        I was not trying to maintain my position but just to follow the "The documentation I could find isn't great on this point" on blokhead response.

        That's also why I used bash docs instead of csh, because they looked more clear to me and with regard to brace expansion, both shells behave the same.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://640950]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-03-29 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found