> > I'd be interested in knowing how to generalize:
> >
> >   ls -1d foo[123].ps
> >
> > (which would list foo1.ps, foo2.ps, foo3.ps).  The generalization
> > would be something like
> >
> >   ls -1d  foo.[html,css,js]
> >
> > to list foo.css, foo,js, and foo.html, but not  foo.js~ or 
> > foo.js-2005-10-23-01
> >
> > The way I know is
> >
> >  shopt -s extglob
> >  ls -1d foo.+(html|css|js)
>
> Isn't this just brace expansion, pioneered in csh but also present in
> bash and ksh.
>
> $ ls -1d foo.{html,css,js}
>
> Works for me.

cool!  knowing what to look for on the bash man page lead to:

  echo {8..12}
  echo {r..z}

which will be handy at times, in place of

  echo $(seq 8 12)

except for the padding option

  echo $(seq -w 8 12)

thanks carl!

> ......... Alternatively:
>
> $ ls foo.* | grep -E '(css|html|js)$'


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to