Toon posts:

[rh7.1] echo \n geeft geen volgende regel

Pagina: 1
Acties:
  • 38 views sinds 30-01-2008

Verwijderd

Topicstarter
Iemand enig idee.

Ik type dus echo blaat \n blaat
dit geeft als resultaat "blaat n blaat"
eigenlijk zou dit toch "blaat"
"blaat"
moet weergeven.
:? :?

Alvast bedankt

Verwijderd

Probeer eens zonder die n dus alleen \

  • Onno
  • Registratie: Juni 1999
  • Niet online
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[Onno@ceres Onno]$ help echo
echo: echo [-neE] [arg ...]
    Output the ARGs.  If -n is specified, the trailing newline is
    suppressed.  If the -e option is given, interpretation of the
    following backslash-escaped characters is turned on:
      \a    alert (bell)
      \b    backspace
      \c    suppress trailing newline
      \E    escape character
      \f    form feed
      \n    new line
      \r    carriage return
      \t    horizontal tab
      \v    vertical tab
      \\    backslash
      \num    the character whose ASCII code is NUM (octal).

    You can explicitly turn off the interpretation of the above characters
    with the -E option.
[Onno@ceres Onno]$ echo bla\nbla
blanbla
[Onno@ceres Onno]$ echo -e bla\nbla
blanbla
[Onno@ceres Onno]$ echo -e bla\\nbla
bla
bla

Trial & error heet dat.

Verwijderd

echo -e "blaat \nblaat"

Dit is letterlijk in de manpages te vinden ;)

man is de grootste vriend van iedereen :P

Dit topic is gesloten.