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]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux