Currently, the file a.txt has:
#define ABC
I want to change a.txt to:
#define ABC
#define DEF
And I tried
sed 's/#define ABC/#define ABC&\n#define DEF/g' a.txt > tmp/test.txt
mv tmp/test.txt > a.txt
but it's giving me #define ABC#define ABCn#define EDF
instead. Tried multiple solutions online but it's not working. What is wrong with my solution? Thanks!!!
Working on Solaris 11