Thread (9 messages) flat view 9 messages, 7 authors, 2016-06-15

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

From: Jason Riedy <hidden>
Date: 2016-06-15 22:42:49

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...
quoted
-			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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help