The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SQL output vertically aligned? swame_sp Shell Programming and Scripting 4 09-11-2009 07:00 PM
Formatting output in columns mohsin.quazi Shell Programming and Scripting 3 08-24-2009 02:44 AM
Displaying Output in Columns jjamd64 Shell Programming and Scripting 1 04-25-2008 06:46 AM
abt viewing all the columns in the output as it is.. RRVARMA UNIX for Advanced & Expert Users 1 03-13-2008 11:46 AM
df output is not aligned. marcogilbert AIX 1 07-06-2005 07:18 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 2 Weeks Ago
nkamalkishore nkamalkishore is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 3
Output columns needs to be aligned

Hi All

I'm running a shell script and the output is something like:

Code:
Col1           Col2       Col3
aaaa      aaaaaaa   aaaaa
bbbbb       bbbbb      bbbbbb
ccc        cccccc    ccccccc
But I require the output to printed as given below:
Code:
Col1           Col2          Col3
aaaa          aaaaaaa     aaaa
bbbbb         bbbbb       bbbbbb
ccc           cccccc      ccccccc
Thanks in advance,
Kamal

Last edited by Franklin52; 2 Weeks Ago at 10:26 AM.. Reason: Please use code tags!!
  #2 (permalink)  
Old 2 Weeks Ago
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,293
Post your script, and we'll see how we can assist.

Regards
  #3 (permalink)  
Old 2 Weeks Ago
nkamalkishore nkamalkishore is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 3
I'm displaying the output using the below echo statement

echo " $line $TAB $TAB $line2 $TAB $TAB $(head -1 /tmp/alias_names.list) $TAB $TAB $TAB $(awk -F" " '{print $2}' /tmp/port.list) "
  #4 (permalink)  
Old 2 Weeks Ago
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,293
Not enough information, post the contents of the variables $line, $line2, the output of
Code:
head -1 /tmp/alias_names.list
the output of
Code:
awk -F" " '{print $2}' /tmp/port.list
and the desired output.
  #5 (permalink)  
Old 2 Weeks Ago
nkamalkishore nkamalkishore is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 3
Those two statements are just print a single variable
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0