On 07/06/2012 03:11 PM, Akim Demaille wrote:
>
> --- a/build-aux/bootstrap
> +++ b/build-aux/bootstrap
> @@ -1,6 +1,6 @@
> #! /bin/sh
> # Print a version string.
> -scriptversion=2012-07-06.11; # UTC
> +scriptversion=2012-07-06.13; # UTC
>
> # Bootstrap this package from checked-out sources.
>
> @@ -77,15 +77,26 @@ Running without arguments will suffice in most cases.
> EOF
> }
>
> -warn()
> +# warnf_ FORMAT-STRING ARG1...
> +warnf_ ()
> {
> - for i
> - do
> - echo "$i"
> - done | sed -e "s/^/$me: /" >&2
> + warnf_format_=$1
> + shift
> + printf "$warnf_format_" "$@" | sed "s,^,$me: ," >&2
>
Why not shave off the extra forks here?
printf "$me: $warnf_format_" "$@" >&2
This shouldn't cause problems, unless '$me' contains '%' or '\' characters.
And anyone naming a script to contain those characters deserves deserves to
suffer anyway ...
Regards,
Stefano