I would like to echo a list all in one line, TAB separated (like ls
does with files in one folder)
for i in one two some_are_very_long_stuff b c; do echo $i; done
will print one line per word:
one
two
some_are_very_long_stuff
b
c
instead I would like to break it, like ls
without options does:
mkdir /tmp/test
cd /tmp/test
for i in one two some_are_very_long_stuff b c z; do touch $i; done
ls
will output
b one two
c some_are_very_long_stuff z
column
command here (frombsdmainutils
on Debian based systems), but of the GNUcolumns
command (from GNUautogen
). – Stéphane Chazelas Nov 20 '13 at 15:08Columns
is more powerful version ofcolumn
, though I had toapt-get install autogen
.column -x
does the job for the simple case, the-x
just changes the order from like first print example, to same ascolumns
. So no spelling error, either will do. – ctrl-alt-delor Nov 20 '13 at 22:18