Re: Bash globbing files only?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

--- "Jacques B." <jjrboucher@xxxxxxxxx> wrote:

> On 1/28/07, Daniel Qarras <dqarras@xxxxxxxxx> wrote:
> > Hi all,
> >
> > with Bash one can list directories (excluding dot dirs) like this:
> >
> > ls [^.]*/
> >
> > How can I list files instead of directories with Bash? I thought
> this
> > would be trivial but I can't find a solution anywhere.
> >
> > Thanks.
> >
> I'm not on my Linux partition so I'm going by memory here, but
> something like:
> 
> ls -lAR / | grep -v "^d"
> 
> That will list Almost all files (exclude . and ..), Recursive, long
> format, then exclude anything that is a directory (as those have the
> d in front of the permissions).

Yep, that would work, but I guess my question was a bit poorly
formulated. I am writing a bash script that has:

dirs=[^.]*/

and I'd like to have "files=..." without using find or other external
commands if at all possible.

Thanks.



 
____________________________________________________________________________________
TV dinner still cooling? 
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.com/

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux