Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.os.unix.shell > #14675
| From | Stefan Wiens <s.wi@gmx.net> |
|---|---|
| Newsgroups | de.comp.os.unix.shell |
| Subject | Re: System und Shell-Scripte: Latin-1 zu UTF-8 |
| Date | 2026-03-08 23:27 +0100 |
| Organization | none |
| Message-ID | <87wlzmnejd.fsf@s-bot.de> (permalink) |
| References | (3 earlier) <83fr6b11ti.fsf@helmutwaitzmann.news.arcor.de> <87h5qrq61l.fsf@s-bot.de> <83a4wi19k1.fsf@helmutwaitzmann.news.arcor.de> <87342ap0zv.fsf@s-bot.de> <83342a103p.fsf@helmutwaitzmann.news.arcor.de> |
Helmut Waitzmann <nn.throttle@erine.email> writes: > Stefan Wiens <s.wi@gmx.net>: >> Helmut Waitzmann <nn.throttle@erine.email> writes: >>> Stefan Wiens <s.wi@gmx.net>: >>>> $ echo >>>> klöä | LC_ALL=de_DE.UTF8 tr [:lower:] [:upper:] >>> >>> Und es empfiehlt sich, ins Shell‐Quoting zu investieren. Ein >>> Beispiel, wo man ohne Shell‐Quoting scheitert: touch -- e && >>> printf '%s\n' klein | LC_ALL=C tr [:lower:] [:upper:] >>> >>> zeigt, warum LC_ALL=C tr '[:lower:]' '[:upper:]' >>> >>> nötig ist. >> >> Könntest du erklären, was bei deinem Beispiel passiert? > > Wenn man „set -x“ einschaltet, sieht man es direkt: touch -- e > printf '%s\n' klein | > ( set -x && LC_ALL=C tr [:lower:] [:upper:] ) > > > Erklärung: „[:lower:]“ ist für das Shell gleichzeitig ein filename > globbing pattern, das auf einen Dateinamen passt, der aus einem > einzigen Zeichen aus der Menge der Zeichen „:“, „l“, „o“, „w“, „e“ > und „r“ besteht. Da es wegen „touch -- e“ einen Dateinamen gibt, der > auf dieses Dateinamensmuster passt, ersetzt das Shell „[:lower:]“ > durch „e“ (und weitere Dateinamen, falls es im Arbeitsverzeichnis > noch weitere passende geben sollte). Nur im Fall, dass kein > passender Dateiname vorhanden oder die Shell‐Option „set -f“ > eingeschaltet ist, übergibt das Shell (beim Bash: abhängig von den > Shell‐Optionen „nullglob“ und „failglob“) den Parameter „[:lower:]“ > so, wie er dasteht, an „tr“. Danke. -- Stefan
Back to de.comp.os.unix.shell | Previous | Next — Previous in thread | Next in thread | Find similar
System und Shell-Scripte: Latin-1 zu UTF-8 Martin Klaiber <usenet.martinkl@gmx.de> - 2026-03-07 13:07 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Tim Ritberg <tim@server.invalid> - 2026-03-07 13:17 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Martin Klaiber <usenet.martinkl@gmx.de> - 2026-03-07 16:34 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Ralph Aichinger <ra@h5.or.at> - 2026-03-07 12:35 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Martin Klaiber <usenet.martinkl@gmx.de> - 2026-03-07 16:33 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Thomas Hochstein <thh@thh.name> - 2026-03-07 14:04 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Urs Janßen <urs@niko.tin.org> - 2026-03-07 15:36 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 ram@zedat.fu-berlin.de (Stefan Ram) - 2026-03-07 16:38 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 ram@zedat.fu-berlin.de (Stefan Ram) - 2026-03-07 16:48 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Urs Janßen <urs@niko.tin.org> - 2026-03-07 16:51 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2026-03-07 20:02 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Urs Janßen <urs@niko.tin.org> - 2026-03-07 20:45 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Urs Janßen <urs@niko.tin.org> - 2026-03-07 20:50 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Helmut Waitzmann <nn.throttle@erine.email> - 2026-03-08 01:25 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Martin Klaiber <usenet.martinkl@gmx.de> - 2026-03-07 16:29 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-07 23:12 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Martin Klaiber <usenet.martinkl@gmx.de> - 2026-03-08 00:42 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Helmut Waitzmann <nn.throttle@erine.email> - 2026-03-08 03:40 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 06:14 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 10:47 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Helmut Waitzmann <nn.throttle@erine.email> - 2026-03-08 19:05 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 20:40 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Helmut Waitzmann <nn.throttle@erine.email> - 2026-03-08 22:29 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 23:27 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 09:36 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 07:17 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 09:56 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Ralph Aichinger <ra@h5.or.at> - 2026-03-08 09:11 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 10:19 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Ralph Aichinger <ra@h5.or.at> - 2026-03-08 10:25 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2026-03-08 10:41 +0000
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 11:52 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Hergen Lehmann <hlehmann-usenet26@snafu.de> - 2026-03-08 10:03 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Michael Bäuerle <michael.baeuerle@gmx.net> - 2026-03-08 10:56 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Stefan Wiens <s.wi@gmx.net> - 2026-03-08 11:19 +0100
Re: System und Shell-Scripte: Latin-1 zu UTF-8 Michael Bäuerle <michael.baeuerle@gmx.net> - 2026-03-08 14:09 +0100
csiph-web