How do I echo one or more tab characters using a bash script? When I run this code
res=\' \'x # res = \"\\t\\tx\" echo \'[\'$res\']\' # expect [\\t\\tx
If you want to use echo "a\tb" in a script, you run the script as:
echo "a\tb"
# sh -e myscript.sh
Alternatively, you can give to myscript.sh the execution permission, and then run the script.
# chmod +x myscript.sh # ./myscript.sh