[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: file test bug in bash 3.1
From: |
Bob Proulx |
Subject: |
Re: file test bug in bash 3.1 |
Date: |
Mon, 22 May 2006 23:27:59 -0600 |
User-agent: |
Mutt/1.5.9i |
Zackary Deems wrote:
> echo "blah" >/tmp/blah
> ln -s /tmp/blah /tmp/blah.link
> if [[ -f "/tmp/blah.link" ]]
> then
> echo "/tmp/blah.link is a regular file"
> else
> echo "/tmp/blah.link is NOT a regular file"
> fi
Thank you for the very nice and concise test case.
> links now match for both links and regular files. This plays hell with
> quite a bit of existing code.
Can you clarify "now" in your statement? As far as I can determine
ksh88, ksh93, zsh, bash-2.x and of course bash-3.x all follow the
symlink for the -f test. So this seems to be the legacy behavior
forever. Symbolic links are generally completely transparent to
applications and I think that includes the -f operator.
Bob