[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Test-ing file types
From: |
Paul Eggert |
Subject: |
Re: Test-ing file types |
Date: |
22 Jul 2003 21:48:27 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Maciek Olczak <address@hidden> writes:
> # echo ~${file}~
> ~~
> # [ -d ${file} ]; echo $?
> 0
POSIX requires this behavior. POSIX says that the shell command
`[ "FOO" ]' exits true (status 0) if "FOO" is not null, false (status
1) otherwise. In this case "FOO" is "-d", which is not null, so
`[ -d ]' must exit true (status 0).
See:
<http://www.opengroup.org/onlinepubs/007904975/utilities/test.html>