<div dir="ltr">I still remember the first time that one bit me: "[ -e path]" fails if path is a dead symlink. There are other pitfalls testing symlinks.  Some idioms I use:<div><br></div><div>Does path exist?</div><div>[ -e path ] || [ -L path ]<br clear="all"><div><br></div><div>Is path really a regular file?</div><div>[ -f path ] && [ ! -L path ]</div><div><br></div><div>A directory?</div><div>[ -d path ] && [ ! -d path ]</div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">James Ronald Lovell <<a href="mailto:ron163264@gmail.com" target="_blank">ron163264@gmail.com</a>><div>Huntsville, AL, USA</div><div><div>A distributed system is one in which the failure of a computer you</div><div>didn't even know existed can render your own computer unusable.</div></div><div>-Leslie Lamport</div></div></div></div></div></div></div></div>