How to simulate column command in Solaris?

Hi,

Does anyone know how to have a similar output like below on Solaris without using column?
The output below is on Linux that uses the column and there is no column command in Solaris.

$ sort /tmp/x.txt | uniq | column -c 50
csfd0   csfd5   mchd11  mchp1   mpeq2   nocd20
csfd1   csfd8   mchd12  mcht1   mpet1   nocd3
csfd10  csfd9   mchd15  mcht11  nocd0   nocd5
csfd11  csft1   mchd2   mcht3   nocd1   nocd8
csfd12  csft11  mchd20  mped0   nocd10  nocd9
csfd15  csft3   mchd3   mped1   nocd11  nocp1
csfd2   mchd0   mchd5   mped10  nocd12  noct1
csfd20  mchd1   mchd8   mped15  nocd15  noct11
csfd3   mchd10  mchd9   mped20  nocd2   noct3

Found this command via Googling. This is more or less what am after but I want to put more spaces between columns though? Any tips on how to do this?

$: sort /tmp/x.txt | uniq | paste -s -d"\t\t\t\t\t\t\t\\t\n" -
csfd0   csfd1   csfd10  csfd11  csfd12  csfd15  csfd2   csfd20  csfd3
csfd5   csfd8   csfd9   csft1   csft11  csft3   mchd0   mchd1   mchd10
mchd11  mchd12  mchd15  mchd2   mchd20  mchd3   mchd5   mchd8   mchd9
mchp1   mcht1   mcht11  mcht3   mped0   mped1   mped10  mped15  mped20
mpeq2   mpet1   nocd0   nocd1   nocd10  nocd11  nocd12  nocd15  nocd2
nocd20  nocd3   nocd5   nocd8   nocd9   nocp1   noct1   noct11  noct3

You should post the contents of your original data (in the file below):

/tmp/x.txt

... if you need expert help.

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