-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 12/2/2006 3:36 AM:
> 
> I was thinking of preferring a shell with a builtin functioning printf,
> if we can find this out portably.  Any idea how we can reliably detect
> a command being builtin?

printf is new enough that shells that support it most likely also support
type.  At any rate, I would assume that this might be a close enough
approximation to what you are asking for, in that it would only give false
negatives:

case `(type printf) 2>/dev/null` in
  *built*in*) echo builtin ;;
  *) echo external or missing ;;
esac

My only concern is whether it would work reliably in MSYS, since Windows
provides a 'type.exe' utility that behaves more like cat; but my
understanding is that running ./configure on MSYS uses bash, where type
and printf are builtins, so I think it will work there, too.

- --
Life is short - so eat dessert first!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFcZ5t84KuGfSFAYARAtQGAKC2ujZUO1ZCibAcbSeay40N/vnrqACfS8wY
x31f3WHL03mV2qfhguBD1BY=
=qB9M
-----END PGP SIGNATURE-----


Reply via email to