-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 11/22/2008 7:31 AM: > Maybe a better suggested test would be one that checks for either print or > printf (that way, a Solaris machine will let ksh pass the suggested test). > Since the overall test is running with stderr silenced, we don't even > have to worry about messages about command not found. In other words, why > not: > > test "X`print -r -- $ECHO`" = "X$ECHO" \ > || test "X`printf %s $ECHO`" = X$ECHO"
Scratch that; Solaris /bin/sh passes that test, so we wouldn't favor ksh. It really boils down to finding a shell with either print or a builtin printf, so I think we have to play the PATH games, and expend the extra fork in looking :( At least we can hard-code the fact that ZSH_VERSION or BASH_VERSION implies a builtin printf, to skip the forks on those shells. - -- 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 iEYEARECAAYFAkkoGQ8ACgkQ84KuGfSFAYBUUACfSnEOeNxt190rKmNMRWpHbd2x 560AoK3c92s6Czz2tCIyyUH3oQAywo5m =8rWl -----END PGP SIGNATURE-----