Tim Alberts wrote:
Why does 'test -f' and 'test -e' return true on a (hidden) file that doesn't exist?

*> cat /home/talberts/.forward*
cat: /home/talberts/.forward: No such file or directory
*> test -f /home/talberts/.forward ;echo $?*
1
*> test -e /home/talberts/.forward ;echo $?*
1


_______________________________________________
It doesn't:

[EMAIL PROTECTED] ~]# cat /tmp/.test1
test1
[EMAIL PROTECTED] ~]# test -f /tmp/.test1 ; echo $?*
0*
[EMAIL PROTECTED] ~]# test -f /tmp/.test1 ; echo $?
0

[EMAIL PROTECTED] ~]# cat /tmp/.test2
cat: /tmp/.test2: No such file or directory
[EMAIL PROTECTED] ~]# test -f /tmp/.test2 ; echo $?
1
[EMAIL PROTECTED] ~]# test -e /tmp/.test2 ; echo $?
1
[EMAIL PROTECTED] ~]#

--

Kind Regards
Rudi Ahlers
CEO, SoftDux

Web:   http://www.SoftDux.com
Check out my technical blog, http://blog.softdux.com for Linux or other 
technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stuff

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Reply via email to