What is the proper way to insert tab in sed? I'm inserting a header line into a stream using sed. I could probably do a replacement of some character afterward to put in tab using regular expression, but is there a better way to do it?
For example, let's say I have:
some_command | sed '1itextTABtext'
I would like the first line to look like this (text is separated by a tab character):
text text
I have tried substituting TAB in the command above with "\t", "\x09", " " (tab itself). I have tried it with and without double quotes and I can't get sed to insert tab in between the text.
I am trying to do this in SLES 9.
To illustrate the fact the BRE syntax for
sed
does mention that\t
is not portable, Git 2.13 (Q2 2017) gets rid of it.See commit fba275d (01 Apr 2017) by Junio C Hamano (
gitster
).(Merged by Junio C Hamano --
gitster
-- in commit 3c833ca, 17 Apr 2017)