I have been putting together a bash script and within it I need to update a file with some neccasary information. The command I am using is below:
sudo sed '
/end/ a\
First line to update\
param 1 'var1'\
param 2 'var2'\
param 3 'var3'\
param 4 'var4'\
end\
' TestFile >TestFileNew
Now this should update the file with the data and should look like this:
end
First line to update
param 1 'var1'
param 2 'var2'
param 3 'var3'
param 4 'var4'
end
The file does get created and the data is in it however it seems to strip the ‘ symbols from the text and I don’t want this to happen, can anyone please help?? An example of what is actually getting produced is below:
end
First line to update
param 1 var1
param 2 var2
param 3 var3
param 4 var4
end
Use
""as the outer quotes: