I want to append 'maildomain'
after the line port
in a php file. I really want to use this solution as this seems the cleanest and very clear so I did
sed -i "350,/port/a \'maildomain\'" file.php
but it came out like this :
351 : 'maildomain'
352 :
353 : 'maildomain'
354 :
...
358 : blablabla port blabla
359 : 'maildomain'
As you can see, it adds 'maildomain'
alternately from line 350 until it found port
which is located at line 354 initially. How do I modify the sed command above to just add 'maildomain'
after port
and not before it? Thank you.
Also, when use line 353 instead of 350, it gives me this :
353 : 'maildomain'
354 : balsdbflasdbflsd port blablablabla
355 : 'maildomain'
Why? Thanks~