Re: Bash globbing files only?
- From: Daniel Qarras <dqarras@xxxxxxxxx>
- Date: Mon, 29 Jan 2007 10:18:27 -0800 (PST)
with Bash one can list directories (excluding dot dirs) like this:this
ls [^.]*/
How can I list files instead of directories with Bash? I thought
would be trivial but I can't find a solution anywhere.
I don't think that it can be done with bash, but if you don't mind
switching to zsh -- another extended version of the Bourne shell --
it does become trivial:
~% ls *(.) # list only plain files
~% ls *(/) # list only directories
~% ls *(*) # list only executable files
Yes, I am painfully aware of the power of zsh :) But in this case I
need to do my script with bash and it seems that although globbing for
directories is trivial ( */ ) there is no similar pattern to match
files. Oh, well, I guess I'll need to waste some CPU cycles and launch
find everytime I need to know file names in the current directory.
Thanks.
____________________________________________________________________________________
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
- Follow-Ups:
- Re: Bash globbing files only?
- From: Cameron Simpson
- Re: Bash globbing files only?
- From: Jacques B.
- Re: Bash globbing files only?
- References:
- Re: Bash globbing files only?
- From: kodis
- Re: Bash globbing files only?
- Prev by Date: Re: OT? VDQ Terminal emulators under FC6
- Next by Date: Re: Howto open xterm to another X virtual monitor
- Previous by thread: Re: Bash globbing files only?
- Next by thread: Re: Bash globbing files only?
- Index(es):
Relevant Pages
|