Answer the question
In order to leave comments, you need to log in
How to replace using sed?
How to replace the first character of each line with the first character of the previous line, leaving the first line unchanged? Awk cannot be used, only sed :(
Answer the question
In order to leave comments, you need to log in
#! /bin/sed -nf
1{p;h;}
2~1{H;x;s/\n.//;p;}
x
s/^\(.\).*$/\1/
h
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question