Skip to content

Comment on Use Zshparent

Comments

  > 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.
    echo file.0{09..11}
    file.009 file.010 file.011

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

  file.{009..011}
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.