Re: Bash globbing files only?

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

 



Try this:

  set -x
  ls [^.]*/
  ls -d [^.]*/
  ls -d */

It would be interesting to see what the differences are, if any.

Thanks for the tip & additional info.  The results of the above after
doing unalias ls and set -x:

(directory names neutered slightly to protect the youngs)

ls [^.]*/
+ ls 'My son'\''s Passion/' Desktop/ download/ 'Final Material/'
ftools/ images/ 'Linux Forensic Documents/' LPIC/ 'Other son -
Profession/' Photos/ PicasaDocuments/ Presentations/ scripts/ thumb/

followed by the content of each of the above folders


The other two yield identical results, being:

+ ls -d 'My son'\''s Passion/' Desktop/ download/ 'Final Material/'
ftools/ images/ 'Linux Forensic Documents/' LPIC/ 'Other son -
Profession/' Photos/ PicasaDocuments/ Presentations/ scripts/ thumb/

followed by the directory names above.

I like that trace feature - lets you see how the globbing gets
expanded.  So we see that the original syntax yields the content of
the directories, whereas as expected the -d only lists the directory
names.

Not to beat a dead horse, but I hate not understanding why something
works (or doesn't work).  Why is it working on yours but not mine?
Are you getting the same trace output for the ls [^.]*/ command, but
without listing the contents of those directories, only the directory
names?

Thanks,

Jacques B.

[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