Given file alfa.txt:
foxtrot
golf
hotel
india
juliet
I would like to insert a newline after lines 2 and 4. I have this command:
ex -sc '2pu_|4pu_|x' alfa.txt
However it is inserting lines after line 2 and 3, instead of 2 and 4:
foxtrot
golf
hotel
india
juliet
:g/^\%2l\|\%4l/pu _