Sponsored Content
Full Discussion: formating output
Top Forums Shell Programming and Scripting formating output Post 302105301 by Krrishv on Thursday 1st of February 2007 03:41:32 AM
Old 02-01-2007
formating output

I have a file proc.txt which contains the below one.

Content-type: text/html

<H2>No query</H2>
infodba-marabou:/tmp
=> export QUERY_STRING="IMAN_server_report=full"
infodba-marabou:/tmp
=> $IMAN_ROOT/web/htdocs/cgi-bin/iman > /tmp/proc.txt
infodba-marabou:/tmp
=> cat proc.txt
Content-type: text/html

<HTML><META HTTP-EQUIV="REFRESH" CONTENT=10><HEAD><TITLE>TcEng Web server report</TITLE>
</HEAD><BODY>
<H1>TcEng Web server report</H1>
<p>Thu Feb 1 00:16:43 2007 - I am alive and well (pid 712), up since Sat Dec 16 22:26:32 2006</p>
<p>click <a href=/iman>here</a> to login to this server</p>
<p>click <a href="/cgi-bin/iman?IMAN_server_report">here</a> for a shortened report</p><p>click <a href="/cgi-
bin/iman?IMAN_server_report=xml">here</a> for an xml report</p><p>Completed 47155 out of 47183 queries; averag
e runtime 2.252 secs (4 timeouts).</p>

<hr>
<H2>Preferences</H2><pre>
Port number: 8181
Select time: 18000
Heartbeat time: 1000
Query time limit: 18000
Maximum number of queries: 750
Minimum number of free processes: 1
Maximum number of processes: 500
Soft login timeout: 120
Hard login timeout: 36000
Process lifespan (in queries): 10000
Maximum login processes per user: 1
Maximum retries on blocked sockets (Windows only): 5
Maximum concurrent logins 500
Maximum CPU usage 80
CPU usage monitoring 0
CPU usage check interval 10
Maximum no of requests/user in queue 5
Maximum length of the queue of pending connections 128
Number of active file descriptors: 1760
Monitoring switch: 1
Internal buffer size: 16384
IMANScript program: /Application/ugs/tceng/tceng0912/web/bin/imanscript
IMAN Document Root: /Application/ugs/tceng/tceng0912/web/htdocs
IMAN Environment:

</pre>
<hr>
<H2>Processes</H2><table align=center width=100% border=1><tr><th>No.</th><th>State</th><th>Query</th><th>Time
s</th><th>User</th><th>Processed</th><th>Syslog</th></tr><tr><td>1</td><td>ready</td><td>&nbsp;</td><td>idle 4
6s</td><td>&nbsp;</td><td>1</td><td>/Application/ugsvols/bldata01/logs/imanscript9994.syslog</td></tr><tr><td>
2</td><td>ready</td><td>&nbsp;</td><td>idle 937s</td><td>&nbsp;</td><td>1</td><td>/Application/ugsvols/bldata0
1/logs/imanscript7599.syslog</td></tr><tr><td>3</td><td>ready</td><td>&nbsp;</td><td>idle 469s</td><td>X036091
&nbsp;</td><td>24</td><td>/Application/ugsvols/bldata01/logs/imanscript1963.syslog</td></tr><tr><td>4</td><td>
ready</td><td>&nbsp;</td><td>idle 7842s</td><td>X045672&nbsp;</td><td>7</td><td>/Application/ugsvols/bldata01/
logs/imanscript16225.syslog</td></tr><tr><td>5</td><td>ready</td><td>&nbsp;</td><td>idle 9989s</td><td>X035077
&nbsp;</td><td>5</td><td>/Application/ugsvols/bldata01/logs/imanscript10210.syslog</td></tr><tr><td>6</td><td>
ready</td><td>&nbsp;</td><td>idle 13089s</td><td>X035466&nbsp;</td><td>5</td><td>/Application/ugsvols/bldata01
/logs/imanscript561.syslog</td></tr><tr><td>7</td><td>ready</td><td>&nbsp;</td><td>idle 18113s</td><td>103818&
nbsp;</td><td>5</td><td>/Application/ugsvols/bldata01/logs/imanscript16278.syslog</td></tr><tr><td>8</td><td>r
eady</td><td>&nbsp;</td><td>idle 11560s</td><td>X039371&nbsp;</td><td>15</td><td>/Application/ugsvols/bldata01
/logs/imanscript15120.syslog</td></tr><tr><td>9</td><td>ready</td><td>&nbsp;</td><td>idle 20340s</td><td>22320
&nbsp;</td><td>4</td><td>/Application/ugsvols/bldata01/logs/imanscript25488.syslog</td></tr><tr><td>10</td><td
>ready</td><td>&nbsp;</td><td>idle 27042s</td><td>&nbsp;</td><td>1</td><td>/Application/ugsvols/bldata01/logs/
imanscript20999.syslog</td></tr><tr><td>11</td><td>ready</td><td>&nbsp;</td><td>idle 27504s</td><td>101568&nbs
p;</td><td>13</td><td>/Application/ugsvols/bldata01/logs/imanscript19396.syslog</td></tr><tr><td>12</td><td>re
ady</td><td>&nbsp;</td><td>idle 29098s</td><td>64920&nbsp;</td><td>10</td><td>/Application/ugsvols/bldata01/lo
gs/imanscript14646.syslog</td></tr><tr><td>13</td><td>ready</td><td>&nbsp;</td><td>idle 30198s</td><td>X030111
&nbsp;</td><td>3</td><td>/Application/ugsvols/bldata01/logs/imanscript7582.syslog</td></tr><tr><td>14</td><td>
ready</td><td>&nbsp;</td><td>idle 31676s</td><td>X041708&nbsp;</td><td>42</td><td>/Application/ugsvols/bldata0
1/logs/imanscript7183.syslog</td></tr><tr><td>15</td><td>ready</td><td>&nbsp;</td><td>idle 34199s</td><td>6773
3&nbsp;</td><td>40</td><td>/Application/ugsvols/bldata01/logs/imanscript18706.syslog</td></tr><tr><td>16</td><
td>ready</td><td>&nbsp;</td><td>idle 31602s</td><td>79826&nbsp;</td><td>14</td><td>/Application/ugsvols/bldata
01/logs/imanscript22502.syslog</td></tr><tr><td>17</td><td>ready</td><td>&nbsp;</td><td>idle 51645s</td><td>&n
bsp;</td><td>1</td><td>/Application/ugsvols/bldata01/logs/imanscript12580.syslog</td></tr><tr><td>18</td><td>r
eady</td><td>&nbsp;</td><td>idle 30371s</td><td>11421&nbsp;</td><td>34</td><td>/Application/ugsvols/bldata01/l
ogs/imanscript29761.syslog</td></tr><tr><td>19</td><td>ready</td><td>&nbsp;</td><td>idle 56147s</td><td>&nbsp;
</td><td>1</td><td>/Application/ugsvols/bldata01/logs/imanscript29658.syslog</td></tr><tr><td>20</td><td>ready
</td><td>&nbsp;</td><td>idle 30908s</td><td>X035887&nbsp;</td><td>74</td><td>/Application/ugsvols/bldata01/log
s/imanscript20039.syslog</td></tr><tr><td>21</td><td>ready</td><td>&nbsp;</td><td>idle 31650s</td><td>X042268&
nbsp;</td><td>95</td><td>/Application/ugsvols/bldata01/logs/imanscript14166.syslog</td></tr><tr><td>22</td><td
>ready</td><td>&nbsp;</td><td>idle 34610s</td><td>X044587&nbsp;</td><td>242</td><td>/Application/ugsvols/bldat
a01/logs/imanscript929.syslog</td></tr><tr><td>23</td><td>ready</td><td>&nbsp;</td><td>idle 80449s</td><td>&nb
sp;</td><td>1</td><td>/Application/ugsvols/bldata01/logs/imanscript18783.syslog</td></tr><tr><td>24</td><td>re
ady</td><td>&nbsp;</td><td>idle 84051s</td><td>&nbsp;</td><td>1</td><td>/Application/ugsvols/bldata01/logs/ima
nscript5679.syslog</td></tr></table>
<hr>
<H2>Queries</H2><p>No queries.</p>

<hr>
<h2>Recently deceased processes</h2><table border=1><tr><th>username</th><th>syslog</th></tr>
<tr><td>90927&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript28329.syslog</td></tr>
<tr><td>11920&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript12775.syslog</td></tr>
<tr><td>83144&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript16492.syslog</td></tr>
<tr><td>&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript23739.syslog</td></tr>
<tr><td>11403&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript10134.syslog</td></tr>
<tr><td>&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript23248.syslog</td></tr>
<tr><td>&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript23153.syslog</td></tr>
<tr><td>X033586&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript1533.syslog</td></tr>
<tr><td>X037095&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript5629.syslog</td></tr>
<tr><td>91011&nbsp;</td><td>/Application/ugsvols/bldata01/logs/imanscript9653.syslog</td></tr>
</table>

In the above i have to get the process id's and idle time as per the above format

for eg in the above you can see the first occurace idle sec's idle 46s and then process for this is 9994 where we have to cut the process id from /Application/ugsvols/bldata01/logs/imanscript9994.syslog the same way we have to see the next occurance of idle secs and process id associated with that. Then i have to kill if the idle secs is greater then 20000sec's is that possible using shell script.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Formating cal output

Hi Gurus, In my Cal output i want to cut the date of 2nd saturday how tyo achive this. for eg in the below output i need that second saturday 13 to be cut. crypto $ cal January 2007 S M Tu W Th F S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26... (2 Replies)
Discussion started by: Krrishv
2 Replies

2. Shell Programming and Scripting

formating array file output using perl

Hello, I am trying to output the values in an array to a file. The output needs to be formated such that each array value is left jusified in a field 8 character spaces long. Also, no more than 6 fields on a line. For example: @array= 1..14; Needs to be output to the file like so: 1 ... (4 Replies)
Discussion started by: seismic_willy
4 Replies

3. Shell Programming and Scripting

Output formating

Dear All I am stuck in one problem. Kindly help me. I am taking below mention file as input file and want some op file as mention below. Kindly send me all possible suggestion and query. Thnaks Jaydeep bELOW IS THE INPUT FILE: *** Connected to BSCANGR ***... (1 Reply)
Discussion started by: jaydeep_sadaria
1 Replies

4. Shell Programming and Scripting

Problem In Formating Table as Output

Hi! I'm working a program that collects 4 various inputs and format my output into tabular form.Problem is my table margins move with different character lengths. Is there a way to fix my table margins even though the variables inside the table varies in length? thank you very much...:( (1 Reply)
Discussion started by: Lo11001
1 Replies

5. Shell Programming and Scripting

formating output

Hi all, I want to start a new topic on this matter I have this script, #!perl use strict; use warnings; use Data::Dumper; open my $log, '>', 'log-external.txt' or die "Could not open log: $!"; print $log "Subnet,Static,DHCP,Unused\n"; open my $dump, '>', 'dump.log' or die... (2 Replies)
Discussion started by: richsark
2 Replies

6. Shell Programming and Scripting

Formating output

Hello Team i have a file with following data (as columns). I need implement a syntax like below for altering table ALTER TABLE1 TABLENAME ADD COLUMN COL1 CHAR(5) NOT NULL WITH DEFAULT ADD COLUMN COL2 CHAR(5) .. .. ADD COLUMN COLn CHAR(5) NOT NULL... (1 Reply)
Discussion started by: rocking77
1 Replies

7. UNIX for Advanced & Expert Users

Formating and Parsing Autosys output

if you want to parse the output from an autosys you can use the below autorep -j Prefix_% | awk '{ if ($6 ~ /^/) printf "%-20s \t\t %-20s\n",$1,$5 ; else if ($6 ~ /^/) printf "%-20s \t\t %-20s\n",$1,$6; else printf "%-20s \t\t %-20s\n",$1,$4 }' | awk '{ if ($2... (1 Reply)
Discussion started by: phpsnook
1 Replies

8. UNIX for Advanced & Expert Users

remove print formating from printer output file

I have a print file taken from the print spooler and I want to delete all the formatting leaving only the text. If you vi the file it shows "\304\304 ...." which translates into a printed line on print output. I need to be able to edit and pass this file to another process Thnaks (10 Replies)
Discussion started by: petercp
10 Replies

9. UNIX for Dummies Questions & Answers

Help with formating when using mailx

Hi I am a newbie here. I tried searching for the solution but I guess I either didn't find it or there hasn't been one posted. my problem is I spooled the results of a query into a .txt file. When I cat the file the formating looks great. All the columns are aligned. However once I mailx the... (2 Replies)
Discussion started by: RB26DETT
2 Replies

10. Shell Programming and Scripting

Formating output in html

Hi Guys, I was searching and landed up something here only. This is the code and I want the formatted html in email but that is not working, anybody knows the reason why? #!/bin/sh set -x DATE=`date -u` # Print beginning of webpage function html_header { cat <<END ... (5 Replies)
Discussion started by: bluemind2005
5 Replies
All times are GMT -4. The time now is 10:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy