Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #264605
| From | Greg Wooledge <greg@wooledge.org> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... |
| Date | 2023-12-11 13:50 +0100 |
| Message-ID | <HJNTr-cQ17-7@gated-at.bofh.it> (permalink) |
| References | <HJEGt-cJY3-1@gated-at.bofh.it> <HJFjb-cKvV-1@gated-at.bofh.it> <HJJwt-cNcV-5@gated-at.bofh.it> <HJJZw-cNr8-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Dec 11, 2023 at 09:37:42AM +0100, tomas@tuxteam.de wrote:
> 2. This is tr, not regexp, so '[A-Za-z0-9.]' isn't doing what you
> think it does. It will match '[', 'A' to 'Z', 'a' to 'z','.' and
> ']'. I guess you want to say 'A-Za-z0-9.'
Well spotted.
> 3. As a convenience, tr has char classes. Perhaps [:alnum:] is for
> you. No idea whether this is a GNU extension
It's POSIX. 100% portable, as long as you ignore any bugs in GNU tr.
Looks like GNU tr in Debian 12 still doesn't handle multibyte characters
correctly:
unicorn:~$ echo 'mañana' | tr ñ X
maXXana
So... as long as you're working in the C locale, where [:alnum:] is
just the ASCII capital and lowercase letters and digits, you should be
fine.
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-11 04:00 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Greg Wooledge <greg@wooledge.org> - 2023-12-11 04:40 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-11 09:10 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... <tomas@tuxteam.de> - 2023-12-11 09:40 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-11 12:30 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... tomas@tuxteam.de - 2023-12-11 13:00 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Greg Wooledge <greg@wooledge.org> - 2023-12-11 13:40 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Greg Wooledge <greg@wooledge.org> - 2023-12-11 13:50 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... <tomas@tuxteam.de> - 2023-12-11 14:20 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Greg Wooledge <greg@wooledge.org> - 2023-12-11 14:30 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-11 15:10 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Max Nikulin <manikulin@gmail.com> - 2023-12-11 16:00 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Greg Wooledge <greg@wooledge.org> - 2023-12-11 16:00 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... <tomas@tuxteam.de> - 2023-12-11 16:10 +0100
"echo" literally in sh scripts (was: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ...) Stefan Monnier <monnier@iro.umontreal.ca> - 2023-12-11 16:20 +0100
Re: "echo" literally in sh scripts (was: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ...) Greg Wooledge <greg@wooledge.org> - 2023-12-11 18:00 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... Albretch Mueller <lbrtchx@gmail.com> - 2023-12-11 20:00 +0100
Re: why would "tr --complement --squeeze-repeats ..." append the substitution char once more? ... debian-user@howorth.org.uk - 2023-12-11 19:20 +0100
csiph-web