How can you group consecutive lines in bash?

I have a file that looks like the following:

a
b
c
d
e
f
g
h
i
j
k
l
m

I want to reformat it like:

a b c
d e f
g h i
j k l
m

I want the number of columns to be configurable. How would you that with bash? I can't think of anything.

9
задан static_rtti 20 May 2011 в 15:48
поделиться