I want to prefix all the lines of a file (except first line) using the first word in a file.
x.o: x.cpp /u/a.h /b.h \ /c.h \
x.o: x.cpp /u/a.h \ x.o: /b.h \ x.o: /c.h \
Can anyone please help me how to solve the above using sed?
You can do it like this with GNU sed:
Or as a separate script:
Run it like this: