Hi.
In the interest of completion, here is one solution: use pr
. The data file had 54 lines in it, so I used a same-length data file with this script:
#!/usr/bin/env bash
# @(#) s1 Demonstrate command "pr" in place of "column".
# Utility functions: print-as-echo, print-line-with-visual-space, debug.
# export PATH="/usr/local/bin:/usr/bin:/bin"
LC_ALL=C ; LANG=C ; export LC_ALL LANG
pe() { for _i;do printf "%s" "$_i";done; printf "\n"; }
pl() { pe;pe "-----" ;pe "$*"; }
em() { pe "$*" >&2 ; }
db() { ( printf " db, ";for _i;do printf "%s" "$_i";done;printf "\n" ) >&2 ; }
db() { : ; }
C=$HOME/bin/context && [ -f $C ] && $C specimen pr align
FILE=${1-data1}
# Utility functions: print-as-echo, print-line-with-visual-space.
pe() { for _i;do printf "%s" "$_i";done; printf "\n"; }
pl() { pe;pe "-----" ;pe "$*"; }
pl " Input data file $FILE:"
specimen $FILE
pl " Results, pr, vertically:"
pr -t -5 data1
pl " Results, pr, horizontally (\"-a: across\"):"
pr -t -5 -a data1
pl " Results, /usr/xpg4/bin/pr vertically:"
/usr/xpg4/bin/pr -t -5 data1
pl " Results, pr, horizontally (\"-a: across\") into align -g: wide gutter:"
pr -t -4 -a data1 |
align -g 10
exit 0
producing:
$ ./s1
Environment: LC_ALL = C, LANG = C
(Versions displayed with local utility "version")
OS, ker|rel, machine: SunOS, 5.11, i86pc
Distribution : Solaris 11.3 X86
bash GNU bash 4.1.17
specimen (local) 1.17
pr - ( /usr/bin/pr, 2016-04-10 )
align 1.7.0
-----
Input data file data1:
Edges: 5:0:5 of 54 lines in file "data1"
one
two
three
four
five
---
fifty
fifty-one
fifty-two
fifty-three
fifty-four
-----
Results, pr, vertically:
one twelve twenty-three thirty-four forty-five
two thirteen twenty-four thirty-five forty-six
three fourteen twenty-five thirty-six forty-seven
four fifteen twenty-six thirty-seven forty-eight
five sixteen twenty-seven thirty-eight forty-nine
six seventeen twenty-eight thirty-nine fifty
seven eighteen twenty-nine forty fifty-one
eight nineteen thirty forty-one fifty-two
nine twenty thirty-one forty-two fifty-three
ten twenty-one thirty-two forty-three fifty-four
eleven twenty-two thirty-three forty-four
-----
Results, pr, horizontally ("-a: across"):
one two three four five
six seven eight nine ten
eleven twelve thirteen fourteen fifteen
sixteen seventeen eighteen nineteen twenty
twenty-one twenty-two twenty-three twenty-four twenty-five
twenty-six twenty-seven twenty-eight twenty-nine thirty
thirty-one thirty-two thirty-three thirty-four thirty-five
thirty-six thirty-seven thirty-eight thirty-nine forty
forty-one forty-two forty-three forty-four forty-five
forty-six forty-seven forty-eight forty-nine fifty
fifty-one fifty-two fifty-three fifty-four
-----
Results, /usr/xpg4/bin/pr vertically:
one twelve twenty-three thirty-four forty-five
two thirteen twenty-four thirty-five forty-six
three fourteen twenty-five thirty-six forty-seven
four fifteen twenty-six thirty-seven forty-eight
five sixteen twenty-seven thirty-eight forty-nine
six seventeen twenty-eight thirty-nine fifty
seven eighteen twenty-nine forty fifty-one
eight nineteen thirty forty-one fifty-two
nine twenty thirty-one forty-two fifty-three
ten twenty-one thirty-two forty-three fifty-four
eleven twenty-two thirty-three forty-four
-----
Results, pr, horizontally ("-a: across") into align -g: wide gutter:
one two three four
five six seven eight
nine ten eleven twelve
thirteen fourteen fifteen sixteen
seventeen eighteen nineteen twenty
twenty-one twenty-two twenty-three twenty-four
twenty-five twenty-six twenty-seven twenty-eight
twenty-nine thirty thirty-one thirty-two
thirty-three thirty-four thirty-five thirty-six
thirty-seven thirty-eight thirty-nine forty
forty-one forty-two forty-three forty-four
forty-five forty-six forty-seven forty-eight
forty-nine fifty fifty-one fifty-two
fifty-three fifty-four
If you can have root access, you can use pkgutil
to install column
:
pkgutil -h
...
Example: pkgutil -i CSWwget (install wget and its dependencies)
Written and maintained by Peter Bonivart. Web site: http://pkgutil.net.
$ pkgutil -a | grep column
column CSWcolumn 8.1,REV=2005.03.06
Best wishes ... cheers, drl