Re: Proposal for new column(1) flag

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

 



oh, your 2 emails indeed didn't come thru ... I guess because there were 3 attachments.

Hereby forwarding...

On 10/17/22 12:27, Thomas Voss wrote:
NOTE: Sorry if this email is a duplicate, I have been trying to send this
for a good while but theres something wrong with my email client
configuration that I need to try to figure out.

Also in my first email I made some references to "center", I actually
meant to say "column", center is just a tool I was writing some code for
when sending that email so it was stuck in my head.

---

On Thu Oct 13, 2022 at 10:43 PM CEST, Bernhard Voelker wrote:
Hmm, you missed to give actual examples.  Is it like the output of
this?

    $ ls * | column -xc $COLUMNS | column -t

Not quite, let me give you a real-world example (and the thing that
prompted me to think of adding this feature).

I have a simple script on my system that has a list of movies, and I want
to be able to display them all nicely in columns.  At the moment I am
doing this, which is not optimal because the gaps between columns are too
large, it results in 5 columns and 8 rows:

    $ column -x movie-list

This is what your suggestion looks like, and it also resuts in 5 columns
and 8 rows but much more squished together:

    $ column -xc $COLUMNS movie-list | column -t

And finally this is a really stupid solution which creates a file for
each line of the file and then uses ls to print them, it results in 6
columns and 6 rows, which is more space-efficient, and what I would like
to be able to get as output:

    #!/bin/sh

    while read f; do
            touch $f
    done <../movie-list
    ls *
    rm *

The outputs are included in files attached to this email

Have a nice day,
Berny




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux