Why is sed not recognizing \t as a tab?
Using Bash you may insert a TAB character programmatically like so:
TAB=$'\t'
echo 'line' | sed "s/.*/${TAB}&/g"
echo 'line' | sed 's/.*/'"${TAB}"'&/g' # use of Bash string concatenation
Not all versions of sed
understand \t
. Just insert a literal tab instead (press Ctrl-V then Tab).