[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: what is the use of -c parameter of column(1), can you demonstrate with an example?



Zhang Weiwu wrote:

>  from man column(1)
> 
>      -c      Output is formatted for a display columns wide.
> 
> Try:
> 
> almustafa@orphalese:~$ echo aaa bbb | column  -c 20
> 
> 
> expected result (17 spaces):
> 
> aaa                bbb
> 
> actual result:
> 
> almustafa@orphalese:~$ echo aaa bbb | column  -c 20
> aaa bbb
> 
> Confusing. Or do I misunderstand the purpose of column(1)?
> 
> Thanks.


-c is for the total number of columns. Having said that, I can't get it
to actually do anything, so I could be wrong.

You could perhaps use awk:

http://unstableme.blogspot.com/2008/12/awk-formatting-fields-into-columns.html

(bit fugly) or, depending on exactly what you need, look at pr(1).

--
Chris Jackson
Shadowcat Systems Ltd.


Reply to: