echo -e "\\t"
echo because backslash is special inside double-quotes in
bash. It serves as an escaping (quoting) operator. In
\\, it escapes itself.
You can either do:
echo -e "\\\\t"
echo to be passed
echo -e "\\\t" would also do), or you could use single quotes within which
\ is not special:
echo -e '\t'
echo is a very unportable command. Even in
bash, its behaviour can depend on the environment. I'd would advise to avoid it and use
printf instead, with which you can do:
Or even decide which parts undergo those escape sequence expansions:
printf 'test\n%s\n' '\test'
printf '%b%s\n' 'test\n' '\test'
%b understands the same escape sequences as
echos), while the first argument to
printf, the format, also understands sequences, but in a slightly different way than
echo (more like what is done in other languages). In any case
\n is understood by both.