how organize my log file ( tabs )


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how organize my log file ( tabs )
# 1  
Old 05-21-2010
how organize my log file ( tabs )

hello

i have written a multitask script which performs verifications on the server (RHEL 5 tikanga); based on list of rules.

since the results are huge both in length and number and I am sending them all to my log file.

Is there any method to organize the STATUS of my results in a defined manner a example of what i want is shown below:

What i have right now

Code:
the verification of abc is OK

]
Code:
the blah blah verification is KO

]
Code:
the verification of abc file presence in xyz dircetory is KO

]

What i would like to have

Code:
the verification of abc is                                OK
the blah blah verification is                             KO
the verification of abc file presence in xyz  dircetory is KO

.


colors shown not important tehy just for highlighting

you may assume i know the length of the longest line


at prensent i am using the command in the follolwing manner

Code:
echo -e "blah blah abc ghj /t/t/t....OK"
echo -e "blah blah abc /t/t....KO"

but its becoming tedious to test every time this "/t " nos.

any method during or post execution is appreciated.

thanks

---------- Post updated at 09:30 AM ---------- Previous update was at 09:28 AM ----------

sorry the result i want is wrong above

Code:
the verification of abc is                                              OK
the blah blah verification is                                           KO
the verification of abc file presence in xyz dircetory is       KO



---------- Post updated at 09:31 AM ---------- Previous update was at 09:30 AM ----------

ok i got it wrong this time too (post does not accept empty space)

the verification of abc is ............................................. OK
the blah blah verification is ...........................................KO
the verification of abc file presence in xyz dircetory is .......KO

Moderator's Comments:
Mod Comment Spaces are preserved in [code][/code] tags

Last edited by Scott; 05-21-2010 at 05:36 AM.. Reason: Code tags, please...
# 2  
Old 05-21-2010
use printf
Code:
printf '%-57s %2s\n' "the verification of abc is" "OK"
printf '%-57s %2s\n' "the blah blah verification is" "KO"
printf '%-57s %2s\n' "the verification of abc file presence in xyz dircetory is" "KO"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Dealing with XLS file with multiple tabs

Hey Guys , Recently working on a requirement , i had to deal with XLS file with multiple tabs and the requirement was as below : 1. Convert one XLS file with multiple tabs to multiple CSV files. -- As i was working on MAC , so it was quite easy through APPLESCRIPT to deal with this.But... (6 Replies)
Discussion started by: himanshu sood
6 Replies

2. UNIX for Advanced & Expert Users

Shell script for dealing with XLS file with multiple tabs/worksheets

Hey Guys , Recently working on a requirement , i had to deal with XLS file with multiple tabs and the requirement was as below : 1. Convert one XLS file with multiple tabs to multiple CSV files. -- As i was working on MAC , so it was quite easy through APPLESCRIPT to deal with this.But... (2 Replies)
Discussion started by: himanshu sood
2 Replies

3. Shell Programming and Scripting

Loop is not reading tabs from the file

Hi, I am on HP-UX and K shell. When I am using while/for loop for reading a file. It is working fine but not reading tabs: Suppose, if the line is: ; ;COMP; ; ; ; then loop is reading as ; ;COMP; ;... (5 Replies)
Discussion started by: ezee
5 Replies

4. Shell Programming and Scripting

Converting specific Excel file tabs to CSV in Python

Hi list, This is probably something really simple, but I am not particularly familiar with Python so I thought I would ask as I know that python has an excel module. I have an excel document with multiple tabs of data and graphs. One of the tabs is just data which I require to have dumped to... (8 Replies)
Discussion started by: landossa
8 Replies

5. Shell Programming and Scripting

Organize file according to their extension

Hi Everyone ! i want to make an application which is written in shell script and in Bourne shell (sh) i want, when my script is executed, it read all the files in the directly and move them to folders according to their extension. suppose i have a files: test.txt test.jpg test.docx... (1 Reply)
Discussion started by: me_newbie
1 Replies

6. Shell Programming and Scripting

Conversion of below Tabs Tex file into CSV format file : shell script needed

Request if some one could provide me shell script that converts the below "input file" to "CSV format file" given Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- ----- ---------------------------------... (7 Replies)
Discussion started by: sreenath1037
7 Replies

7. Shell Programming and Scripting

clear extra spaces and tabs in a file

Any help appreciated Thanks sample input: > (extra spaces&tabs in here) test1 (extra spaces&tabs in here) 123.123.123.123 (extra spaces&tabs in here) abc (extra spaces&tabs in here) 123 --- < (extra spaces&tabs in... (3 Replies)
Discussion started by: goofist
3 Replies

8. Shell Programming and Scripting

Remove Tabs from file.

I was trying to remove tabs from the file using the below command it works when run on command prompt but doesnt works when operated on a file. echo " New name" | sed -e 's/*//' (7 Replies)
Discussion started by: dinjo_jo
7 Replies

9. UNIX for Dummies Questions & Answers

two csv file in an excel file in two tabs

Hi, I was wondering if anybody could help me with this. I have two .csv file that I need to put it in an excel file in two different tabs using Shell Script. Thanks in advance. JP (7 Replies)
Discussion started by: JPalt
7 Replies

10. Shell Programming and Scripting

How to delete multiple space or tabs from a read only file

Hi, Actually I am want to cut the three fields of "file-nr" file. $ cat /proc/sys/fs/file-nr 638 219 52270 I want to assign these value to diffrent varibales as follow:- a=638 b=219 c=52270 I tried to use cut command for this purpose and also tried to squeeze all sapces... (6 Replies)
Discussion started by: bisla.yogender
6 Replies
Login or Register to Ask a Question