Minh Van <[EMAIL PROTECTED]> wrote:
> 1. if [ -n $dirname ] && [ \( -d $dirname \) -a \( -x $dirname \) ];
> then
> 2. if [ -n $dirname ] && [ -d $dirname ] && [ -x $dirname ]; then
Use the second form whenever you can. && is guaranteed to short circuit while
-a never does. Also, to use -a safely you have to put in those ugly
brackets :)
And if you shell doesn't have test built-in, well, dump it :)
--
Debian GNU/Linux 2.1 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text