Results 1 to 2 of 2

Thread: echo - backslash interpretation

  1. #1
    Join Date
    2021-Nov
    Posts
    1

    echo - backslash interpretation

    When looking at echo's manual page, I see -E is used by default:
    -n do not output the trailing newline
    -e enable interpretation of backslash escapes[/HTML]
    -E disable interpretation of backslash escapes (default)

    But why -E needs to be added anyway to disable this interpretation ?

    Code:
    $ echo "Hello \t \World"
    Hello    \World
    
    $ echo -E "Hello \t \World"
    Hello \t \World
    Shouldn't it be used by default ?

  2. #2
    Join Date
    2021-May
    Location
    UK
    Posts
    772
    It is used by default, but lets say you decide to change it to enabled -e, it then stays that way (not set at default) until you actually change it back, so yes, -E is also 'needed'....

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •