By default, echo does not escape the backslash escapes. But you can use echo -e option for interpretation of backslash escapes. This is particularly useful if you want to print multiple lines using echo command.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
echo "\thello" ## returns \thello echo -e "\thello" ## returns hello echo -e "line one\nline two" ## returns ## line one ## line two echo -e "\vverticale_tab1\v\nverticale_tab2" echo -e "\thorizontal_tab1 \thorizontal_tab2" echo -e "\aalert" echo -e "\bbackspace" echo -e "hello\csupress further output" echo -e "\fform feed" echo -e "hello\rcarriage return" echo -e "\\ backslash" echo -e "\e[32mGreen" echo -e "\0043" echo -e "\x5E" echo -e "hello\n\tworld" |