I'm using sed and i have a file which contains
apple
orange
banana
orange
i want to insert "pear" after the 1st orange only . So the output should be something like this
apple
orange
pear
banana
orange
I used this sed option:
sed -i '0,/orange/a pear' filename
but this gives me a output something like this:
apple
pear
orange
pear
banana
orange