Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Working with Binary Numbers

by blokhead (Monsignor)
on Sep 25, 2007 at 14:30 UTC ( #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


Comment on Re^3: Working with Binary Numbers
Select or Download Code
Re^4: Working with Binary Numbers
by salva (Monsignor) 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
Node Status?
node history
Node Type: note [id://640950]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2014-07-28 20:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (209 votes), past polls