[linux-l] Bash und utf8

Olaf Radicke olaf_rad at gmx.de
Mo Dez 11 21:43:04 CET 2006


Am Montag, 11. Dezember 2006 16:30 schrieb Jan-Benedict Glaw:
> On Mon, 2006-12-11 15:45:00 +0100, Olaf Radicke <olaf_rad at gmx.de> wrote:
> > Ich hab hier (unter Fedora Core 6) ein Problem:
> >
> > Die Bash kommt mit utf8 nicht klar. Wenn ich ein simples bash-Skript
> > schreibe mit erste Zeile "#!/bin/bash" und u+x und das als utf8
> > speichere, bekommt die bash eine Krise:
> >
> > [or at localhost src]$ ./install.sh
> > bash: ./install.sh: cannot execute binary file
>
> Mach mal:
>
> 	cat ./install.sh | cut -b -10 | xxd
>
> und schick' das Ergebnis. Könnte sein, daß Dein Editor da eine BOM
> (Byte Order Mark) eingebaut hat...

[or at localhost var]$ 
cat /HDC/PRIVAT_DATA/SONSTIGES/sandbox/artikel23/trunk/src/install.sh | 
cut -b -10 | xxd
0000000: efbb bf23 2120 2f62 696e 0a23 2044 6965  ...#! /bin.# Die
0000010: 7320 6973 740a 2320 4576 656e 7475 656c  s ist.# Eventuel
0000020: 0a23 2044 6174 6569 656e 200a 6563 686f  .# Dateien .echo
0000030: 2022 5374 6172 0a65 6368 6f20 2245 7273   "Star.echo "Ers
0000040: 740a 6d6b 6469 7220 2f6f 7074 0a65 6368  t.mkdir /opt.ech
0000050: 6f20 224b 6f70 690a 6370 202d 7652 202d  o "Kopi.cp -vR -
0000060: 2d62 0a63 7020 2d76 202d 2d62 610a 6370  -b.cp -v --ba.cp
0000070: 202d 7620 2d2d 6261 0a63 7020 2d76 202d   -v --ba.cp -v -
0000080: 2d62 610a 6370 202d 7620 2d2d 6261 0a65  -ba.cp -v --ba.e
0000090: 6368 6f20 2253 6574 7a0a 6368 6d6f 6420  cho "Setz.chmod
00000a0: 2d76 5220 0a63 686d 6f64 202d 7652 200a  -vR .chmod -vR .
00000b0: 6368 6d6f 6420 2d76 5220 0a65 6368 6f20  chmod -vR .echo
00000c0: 2253 6574 7a0a 6c6e 202d 7620 2f6f 7074  "Setz.ln -v /opt
00000d0: 0a65 6368 6f20 222e 2e2e 450a            .echo "...E.

Was übrigens geht ist....
cat ./install.sh | bash


Gruß
Olaf




Mehr Informationen über die Mailingliste linux-l