Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264
Source Link
munHunger
  • 151
  • 1
  • 11

sed not parsing \t as a tab

I am trying to insert a line into a coffee script using sed and it looks as if it is ignoring my first tab character.

The file I want to insert into has a line like this:

    karmaServer.start

and I want to insert a line after it like this:

    karmaServer.start
        flags: ['--no-sandbox']

So I wrote a sed script that I think should work

sed "/^\t\tkarmaServer.start/a\t\t\t\tflags: ['--no-sandbox']" build/unit-test.coffee 

although the result is quite odd. I get the following

    karmaServer.start
t       flags: ['--no-sandbox']

And I don't understand why it starts the line with a t character or how to get rid of it.

any ideas?