7 ms·
> How do I pick 9-11 in bash? Like so: file.{9..11} I think that you mean for the files to be numbered like: file.009 file.010 file.011 Bash would
by pyre 14y ago
> How do I pick 9-11 in bash?
Like so:
file.{9..11}
I think that you mean for the files to be numbered like:
file.009
file.010
file.011
Bash would try to expand:
file.{9..11} => file.9 file.10. file.11
file.0{9..11} => file.09 file.010 file.011
file.00{9..11} => file.009 file.0010 file.0011
Neither would match all files.
- lutusp 14y ago> Neither would match all files. True, but this works: file.*{9..11} It globs on the LHS, and requires the RHS to be literally consistent with the generated index. I had the same problem with my earlier example, and the above is how I worked it out.
- dredmorbius 14y agoecho file.0{09..11} file.009 file.010 file.011
- aw3c2 14y agofile.{009..011}