You could always use find.

> find . -name '[A-Z]*' -maxdepth 1

It treats [] specially just like bash.

Alternatively, you could just invoke bash.

> bash -c 'echo [A-Z]*'

-Kevin

On Jul 19, 2012, at 2:39 AM, Jon Clayden <jon.clay...@gmail.com> wrote:

> Hi,
> 
> Sorry if this is already covered somewhere fairly obvious and I've missed 
> it...
> 
> Fish has really impressed me in a short space of time, enough for me
> to try it as my default shell. Generally, it's been a pleasure so far.
> But amongst the things I miss from bash is being able to use character
> class syntax within shell globs, viz.
> 
> $ echo [A-Z]*
> 
> to echo all files starting with an upper-case letter. (I know this is
> a silly example, but it illustrates the point.) So I was wondering
> what the easiest way to achieve something like this is in fish. One
> possibility might be
> 
> $ echo (ls -1 | grep '^[A-Z].*')
> 
> but this is a bit verbose, and I always have to remember to switch
> from glob syntax to grep regex syntax, adding the '^' and '.' (and the
> quotes) to achieve the same effect. Is there a more elegant route?
> 
> Thanks in advance,
> Jon
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to