This should almost be safe as no sane person would have a remote
whose name is 'foo%s'...
Why not go all the way, and make it safe, regardless of embedded %,
embedded \, or leading -?
name=$(printf -- %s "$f" | tr -c "A-Za-z0-9" ".")
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----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
iD8DBQFFrEHw84KuGfSFAYARAlH9AJ9q3atCpSVBTg0SVhZ4DQ9T7qiqEQCfe9D2
bGTfwnvW6uN1ky6ncWYgkgc=
=P9t5
-----END PGP SIGNATURE-----
From: Horst H. von Brand <hidden> Date: 2016-06-15 22:42:49
Junio C Hamano [off-list ref] wrote:
Jason Riedy [off-list ref] writes:
quoted
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?
Here (Fedora rawhide) /usr/bin/printf is part of coreutils.
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria +56 32 2654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 2797513
From: Junio C Hamano <hidden> Date: 2016-06-15 22:42:49
"Horst H. von Brand" [off-list ref] writes:
Junio C Hamano [off-list ref] wrote:
quoted
Jason Riedy [off-list ref] writes:
quoted
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?
Here (Fedora rawhide) /usr/bin/printf is part of coreutils.
I am reasonably sure people on Linux land would be fine
regardless of distros, but thanks anyway.
The problematic are less common ones, ranging from (not so less
common) OSX, Solaris to (much less common) AIX that some people
seem to run git on (or at least compile git for).
From: Brian Gernhardt <hidden> Date: 2016-06-15 22:42:49
On Jan 17, 2007, at 12:33 PM, Junio C Hamano wrote:
The problematic are less common ones, ranging from (not so less
common) OSX, Solaris to (much less common) AIX that some people
seem to run git on (or at least compile git for).
At least as far a OS X goes, it's installed on my machine (10.4.8)
as /usr/bin/printf. I don't know if it's part of the Xcode packages,
the "BSD Subsystem", or the core OS but I have a hard time imagining
someone who didn't have them all installed using GIT.
Also, it's man page identifies itself as
"PRINTF(1) BSD General Commands Manual
PRINTF(1)"
so most, if not all, flavors of BSD and BSD-like should be alright.
~~ Brian
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?
Here (Fedora rawhide) /usr/bin/printf is part of coreutils.
I am reasonably sure people on Linux land would be fine
regardless of distros, but thanks anyway.
The problematic are less common ones, ranging from (not so less
common) OSX, Solaris to (much less common) AIX that some people
seem to run git on (or at least compile git for).
printf is a bash builtin ... not sure about other shells.
--
Julian
---
A lifetime isn't nearly long enough to figure out what it's all about.
From: Horst H. von Brand <hidden> Date: 2016-06-15 22:42:49
Julian Phillips [off-list ref] wrote:
[...]
printf is a bash builtin ... not sure about other shells.
It's a builtin in zsh and in ksh, and /not/ in tcsh here (Fedora rawhide)
zsh-4.2.6-3.fc7
ksh-20060214-1.1
tcsh-6.14-13
It might be special configuration, but as they are mentioned in the manpages
I'd guess not.
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria +56 32 2654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 2797513
From: Simon 'corecode' Schubert <hidden> Date: 2016-06-15 22:42:49
Junio C Hamano wrote:
quoted
quoted
We have done this already so it might be too late to raise this
question, but does everybody have printf?
The problematic are less common ones, ranging from (not so less
common) OSX, Solaris to (much less common) AIX that some people
seem to run git on (or at least compile git for).
printf(1) is part of POSIX/SUSv3, so systems *should* have it.
cheers
simon
--
Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\
Work - Mac +++ space for low €€€ NOW!1 +++ Campaign \ /
Party Enjoy Relax | http://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \