See the example below:
cat << EOF
alias\tVARIABLE = command
EOF
The run output does not take into account the regex \t
.
See the example below:
cat << EOF
alias\tVARIABLE = command
EOF
The run output does not take into account the regex \t
.
cat
does not interpret escape codes but there are several ways to do it, one of them is to use echo :
echo -e "alias\tVARIABLE = command"
That will return the string alias VARIABLE = command
with the tab replaced.
Incidentally, by default, also does not interpret escapes and needs the -e parameter and this is unnecessary in the case of Dash strong>.
But if you really need the operation to go through echo
, you can use process substitution:
cat <( echo -e "alias\tVARIABLE = command" )
That is, the output of cat
will be sent to the input of echo
as if it were an input file (such as cat
).