Re: Bash globbing files only?

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

 



On 30Jan2007 09:08, Daniel Qarras <dqarras@xxxxxxxxx> wrote:
| PS. A hard headed zsh user would continue to complain that there's no
| way to differ between files and links in bash without find but I won't
| go into that :)

A POSIX shell requires that the test command supports this:

       -h  file
              True if file exists and is a symbolic link.
       -L  file
              True if file exists and is a symbolic link.

There are two letters for historic reasons. Bash supports both, and so
does zsh.

Of course, if you mean a hardlink, then you're asking a question
that is meaningless.

BTW, I tend to test directorishness like this:

  [ -d foo/. ]

which works for a directory or a symlink that resolves to a directory.
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

I am a kind of burr; I shall stick.
        - William Shakespeare, _Measure for Measure_


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux