$ echo "HMM\tThis line got a TAB"
HMM\tThis line got a TAB
So it did not work !
To use tabs, new-line, and other formatting characters with UNIX/Linux echo command, specify the -e option:
$ echo -e "HMM\tThis line got a TAB"
HMM This line got a TAB
$ echo -e "A B\nC\nD"
From ECHO(1) man page:
-e enable interpretation of backslash escapes
If -e is in effect, the following sequences are recognized:
\a alert (BEL)
\c suppress trailing newline
\f form feed
\n new line
\r carriage return
\t horizontal tab
\v vertical tab
- Grep and print control characters in a file - UNIX
- Highlight match with color in UNIX grep command
- Print only matched string, not line in grep command