For a sed insertion, the line inserted does not have spaces, how can i add spaces?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
#!/bin/bash
sed -i.backup $'
/def test/ i\
@unittest.skip("skipping")
' inputfile.txt
If inputfile.txt contains
class A():
def test_function(def)
After running the script i would like to have
class A():
@unittest.skip("skipping")
def test_function(def)
Unfortunately, as the script exists now i am getting
class A():
@unittest.skip("skipping")
def test_function(def
How can I add a space within the single quote
bash sed regular-expression
add a comment |Â
up vote
0
down vote
favorite
#!/bin/bash
sed -i.backup $'
/def test/ i\
@unittest.skip("skipping")
' inputfile.txt
If inputfile.txt contains
class A():
def test_function(def)
After running the script i would like to have
class A():
@unittest.skip("skipping")
def test_function(def)
Unfortunately, as the script exists now i am getting
class A():
@unittest.skip("skipping")
def test_function(def
How can I add a space within the single quote
bash sed regular-expression
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
#!/bin/bash
sed -i.backup $'
/def test/ i\
@unittest.skip("skipping")
' inputfile.txt
If inputfile.txt contains
class A():
def test_function(def)
After running the script i would like to have
class A():
@unittest.skip("skipping")
def test_function(def)
Unfortunately, as the script exists now i am getting
class A():
@unittest.skip("skipping")
def test_function(def
How can I add a space within the single quote
bash sed regular-expression
#!/bin/bash
sed -i.backup $'
/def test/ i\
@unittest.skip("skipping")
' inputfile.txt
If inputfile.txt contains
class A():
def test_function(def)
After running the script i would like to have
class A():
@unittest.skip("skipping")
def test_function(def)
Unfortunately, as the script exists now i am getting
class A():
@unittest.skip("skipping")
def test_function(def
How can I add a space within the single quote
bash sed regular-expression
bash sed regular-expression
asked 16 mins ago
Matt Mclaughlin
31
31
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Â
draft saved
draft discarded
Â
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479007%2ffor-a-sed-insertion-the-line-inserted-does-not-have-spaces-how-can-i-add-space%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password