[olug] script help

jonny at bashhacker.com jonny at bashhacker.com
Fri Feb 22 19:01:00 UTC 2008


humf, sounds like this script might help?

http://bashhacker.com/code/tokSandwich.sh.html

it finds a token between two other tokens in a file and gives you back all
the lines starting with the line that contains the start token and ending
with the line that contains the end token.

does that help?

-Jonny

>
> the output that i am sorting through is in a saved file simmular to the
> below
>
> @d1 ---- unit1 -------
>
>  10:37pm  up 133 days,  4:16, 12 users,  load average: 0.09, 0.06, 0.00
> 250 processes: 248 sleeping, 1 running, 1 zombie, 0 stopped
> CPU0 states:  0.0% user,  0.0% system,  0.0% nice, 100.0% idle
> CPU1 states:  0.1% user,  4.0% system,  0.0% nice, 94.0% idle
> Mem:   513896K av,  495828K used,   18068K free,       0K shrd,  154432K
> buff
> Swap: 1056124K av,  222220K used,  833904K free                   92060K
> cached
>
>   PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
>     1 root      15   0   480  432   432 S     0.0  0.0   2:49 init
>     2 root      15   0     0    0     0 SW    0.0  0.0   0:00 keventd
>     3 root      34  19     0    0     0 SWN   0.0  0.0   0:01
> ksoftirqd_CPU0
>     4 root      34  19     0    0     0 SWN   0.0  0.0   0:01
> ksoftirqd_CPU1
>     5 root      15   0     0    0     0 SW    0.0  0.0   5:21 kswapd
>     6 root      15   0     0    0     0 SW    0.0  0.0   0:00 bdflush
>     7 root      15   0     0    0     0 SW    0.0  0.0  24:48 kupdated
> @d2
>
> @d1 ---- unit2 -------
>
>  10:37pm  up 123 days,  4:16, 45 users,  load average: 0.12, 0.10, 0.26
> 250 processes: 248 sleeping, 51 running, 1 zombie, 0 stopped
> CPU0 states:  0.0% user,  0.0% system,  0.0% nice, 100.0% idle
> CPU1 states:  0.1% user,  4.0% system,  0.0% nice, 94.0% idle
> Mem:   513896K av,  495828K used,   18068K free,       0K shrd,  154432K
> buff
> Swap: 1056124K av,  222220K used,  833904K free                   92060K
> cached
>
>   PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
>     1 root      15   0   480  432   432 S     0.0  0.0   2:49 init
>     2 root      15   0     0    0     0 SW    0.0  0.0   0:00 keventd
>     3 root      34  19     0    0     0 SWN   0.0  0.0   0:01
> ksoftirqd_CPU0
>     4 root      34  19     0    0     0 SWN   0.0  0.0   0:01
> ksoftirqd_CPU1
>     5 root      15   0     0    0     0 SW    0.0  0.0   5:21 kswapd
>     6 root      15   0     0    0     0 SW    0.0  0.0   0:00 bdflush
>     7 root      15   0     0    0     0 SW    0.0  0.0  24:48 kupdated
> @d2
>
>
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
>
>
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug
>





More information about the OLUG mailing list