Hello,
In a Bourne shell script I have some variables ($SYSTEM, $STATUS, $CONNECTIONS,$STARTUP_TIME etc.) that I want to print to the console output in a symetrical way. I want the values to line up with the column headers.
My problem is that the values are not fixed length and thus do not always align. I tried using awk and entering a tab (by hand pressing the tab key for OFS) but this was kluugy.
Using Perl and other languages with stronger console output features is not an option.
What can you recommend?
Thanks,
JT
In a Bourne shell script I have some variables ($SYSTEM, $STATUS, $CONNECTIONS,$STARTUP_TIME etc.) that I want to print to the console output in a symetrical way. I want the values to line up with the column headers.
Code:
System Status Connections Startup
-------------------------------------
SYS01 OPEN 150\25 2007-06-22
SYS02 OPEN 150\102 2007-06-02
SYS03 MAINT 150\43 2007-05-14
My problem is that the values are not fixed length and thus do not always align. I tried using awk and entering a tab (by hand pressing the tab key for OFS) but this was kluugy.
Using Perl and other languages with stronger console output features is not an option.
What can you recommend?
Thanks,
JT