Hi all,
I have to append every alternate line after its previous line. For example if my file has following contents
line 1: unix is an OS
line 2: it is open source
line 3: it supports shell programming
line 4: we can write shell scripts
Required output should be
line1: unix is an OS it is open source
line 2: it supports shell programming we can write shell scripts
I think this could be done using sed, but how could i do this please help?
If it cant be done using sed then please suggest other methods
Hi anchal,
thanks for replying
Actually i m very new to unix, therefore not able to figure it out how to do that. Can u please help me how could i do that?
Thanks
Looks like homework... a bit... and posting homework/classroom stuff here is forbidden.. nevertheless. Your part is to look up how it works
root@isau02:/data/tmp/testfeld> cat infile
unix is an OS
it is open source
it supports shell programming
we can write shell scripts
root@isau02:/data/tmp/testfeld> sed 'N; s/\n/ /' infile
unix is an OS it is open source
it supports shell programming we can write shell scripts