Would like to have each line in a file repeated a fixed number of times.e.g. have each line repeated four times:abcbecomes:aaaabbbbccccI've done some searching, and there are a lot of questions and answers along the lines of doing the reverse, e.g. merging duplicate lines into single lines, and maybe a few about doubling lines by printing them again.It would be easy to do this in C, but I wish I knew more about the native commands so I wouldn't have to resort to these kinds of one-off throw-aways all the time.
Repeat each line multiple times
text processing;sed;awk;perl
Perl:perl -ne 'for$i(0..3){print}' fileand I have to add this one posted as a comment by @derobert because it is just cool:perl -ne 'print $_ x4'awk and variants:awk '{for(i=0;i<4;i++)print}' filebash while read line; do for i in {1..4}; do echo $line; done; done < file