This is the file I need help with:
Code:
# test.txt
config 'zone'
option 'name' 'wan'
option 'input' 'REJECT'
option 'output' 'ACCEPT'
option 'forward' 'REJECT'
option 'masq' '1'
option 'mtu_fix' '1'
I want to use sed to append a line after
Code:
option 'name' 'wan'
So that it looks like:
Code:
# test.txt
config 'zone'
option 'name' 'wan'
option 'network' 'wan vpn'
option 'input' 'REJECT'
option 'output' 'ACCEPT'
option 'forward' 'REJECT'
option 'masq' '1'
option 'mtu_fix' '1'
This is what I am trying:
Code:
sed -i "/option 'name' 'wan'/a \
option 'network' 'wan vpn'" test.txt
And this is what I get:
Code:
# test.txt
config 'zone'
option 'name' 'wan'
option 'network' 'wan vpn'
option 'input' 'REJECT'
option 'output' 'ACCEPT'
option 'forward' 'REJECT'
option 'masq' '1'
option 'mtu_fix' '1'
I don't mean to be picky but can I get that 4th line to "tab" in? It just looks ugly.
-