Re: [PATCH] Replace "echo -n" with printf in shell scripts.

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

 



Jason Riedy <ejr@xxxxxxxxxxxxxxxxx> writes:

> Not all echos know -n.  This was causing a test failure in
> t5401-update-hooks.sh, but not t3800-mktag.sh for some reason.

We have done this already so it might be too late to raise this
question, but does everybody have printf?

> diff --git a/contrib/remotes2config.sh b/contrib/remotes2config.sh
> index 25901e2..b996996 100644
> --- a/contrib/remotes2config.sh
> +++ b/contrib/remotes2config.sh
> @@ -11,7 +11,7 @@ if [ -d "$GIT_DIR"/remotes ]; then
>  	{
>  		cd "$GIT_DIR"/remotes
>  		ls | while read f; do
> -			name=$(echo -n "$f" | tr -c "A-Za-z0-9" ".")
> +			name=$(printf "$f" | tr -c "A-Za-z0-9" ".")

This should almost be safe as no sane person would have a remote
whose name is 'foo%s'...

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]