Steuerzeichen falsch interpretiert

PhoenixDH

Erfahrenes Mitglied
Hab ein Problem, das Steuerzeichen wie z.B. \n nicht interpretiert werden, d.h. aus:
Code:
echo "\nHallo Welt\n

kommt als Ausgabe

nHallo Welt\n

ohne Zeilenumbruch !

Woran könnte das liegen ?
 
:rolleyes: Mhm hättest du dir die man Page zu echo angeschaut, hättest du folgendes rausgefunden:

Code:
...
      -e     enable interpretation of the backslash-escaped characters listed below

       -E     disable interpretation of those sequences in STRINGs

       --help display this help and exit

       --version
              output version information and exit

       Without -E, the following sequences are recognized and interpolated:

       \NNN   the character whose ASCII code is NNN (octal)

       \\     backslash

       \a     alert (BEL)

       \b     backspace

       \c     suppress trailing newline

       \f     form feed

       \n     new line

       \r     carriage return

       \t     horizontal tab

       \v     vertical tab
...

Gruß

RedWing
 
Zurück