autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for problems with echo '-...' and echo '...\...'


From: Eric Blake
Subject: Re: patch for problems with echo '-...' and echo '...\...'
Date: Sat, 02 Dec 2006 08:40:30 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.666

-----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             address@hidden
-----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

[Prev in Thread] Current Thread [Next in Thread]