-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Charles Wilson on 8/21/2008 9:11 PM: > > if [ shell_fun_call -a $var -eq "foo" ] > > doesn't work. It should be > > if ( shell_fun_call && [ $var -eq "foo" ])
You don't necessarily need the extra subshells. if shell_fun_call && [ $var -eq "foo" ] is valid shell, provided $var is guaranteed to be non-empty, doesn't start with any character that might confuse test (such as '-', '!', '(', etc.), and doesn't contain whitespace. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkiuQ18ACgkQ84KuGfSFAYDNSQCfcaIQz8MZPUkFUSzmZW5++XW/ BI4An1Z39VnnQfHI6W7FoC65MkpKez1a =EcWz -----END PGP SIGNATURE----- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/