UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 15th, 2006, 01:16 PM
jirayria jirayria is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 39 jirayria User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 47 m 16 sec
Reputation Power: 5
Output formatting

Hi,

Below is some code that i have written:

Code:
grep -c "$month" ./logs/*.logs | sed 's/\.\/logs\//\t/g' | sed 's/.logs:/\t/g'


This searches the log directory for the .log files based on the month that the user enters into the program. It then outputs the name of each .log file and the matches to the right of it.
The problem is i cant get the matches to all become alligned in a seperate column to the log names. I have a "\t" to try and tab them accross, but as some of the filenames are longer than the others they do not all align properly.
Could anyone help me with this?

Thanks

Reply With Quote
  #2  
Old May 15th, 2006, 04:11 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,482 jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 16 h 40 m 40 sec
Reputation Power: 825
Isn't this what awk does?
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #3  
Old May 16th, 2006, 06:27 AM
jirayria jirayria is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 39 jirayria User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 47 m 16 sec
Reputation Power: 5
Yeah, I was just wondering if there were any other ways around it, opposed to using awk.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Output formatting


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT