in reply to Re^2: String expansion script
in thread String expansion script

Brace expansion is not specific to pathname matching. I've shown you: type

echo a{1..3}
you get
a1 a2 a3
even if such files do not exist.
echo > a1; ls a{1..3}
prints
ls: a2: No such file or directory ls: a3: No such file or directory a1

There is a filename matching feature too, in bash it looks like this:

shopt -s extglob echo a@(1|2|3)
is really similar to the friendly echo a[1-3], it prints
a1
if a1 exists but the other files don't. (Don't ask me how it works in zsh.) There is no numeric range variant of this though.

Replies are listed 'Best First'.
Re^4: String expansion script
by jdporter (Paladin) on Feb 03, 2005 at 20:52 UTC
    Yah, I know. That occurred to me after I posted. /me hasn't had his cup of coffee yet.