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

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

 



And Junio C Hamano writes:
> We have done this already so it might be too late to raise this
> question, but does everybody have printf?

It's in the Single Unix Spec as the alternative to non-portable
echo uses:
  http://opengroup.org/onlinepubs/007908799/xcu/echo.html#tag_001_014_525
And no one has complained so far...

> > -			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'...

Forgot about that, thanks.  It should be printf "%s" "$f".

Jason
-
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]