Noticed IF test for dir. "-d" IDs a link also...

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

Noticed IF test for dir. "-d" IDs a link also...

#1 Post by sunburnt »

As you can see it IDs the link as a link and a dir both.

Code: Select all

sh-4.1# [ -L /root/my-documents ]&& echo GOOD!
GOOD!
sh-4.1# [ -d /root/my-documents ]&& echo BAD!
BAD!
Fortunately it doesn`t ID a dir. as a link.

Post Reply