comparision script

comparision script

am 24.09.2007 12:18:51 von Jobs Circular group

Hi,



I am working on the Storage related script. i caputred following
sample output :
69
00
13
00
00
00
00
00
00
00
00
02
27

Above output is for the TIME (hour) of the snapshot i want the all
values which Greter than 8 (hours)
how can i compair above value with the 8 ( 00,01,02 values i want to
convert in 1,2,3,4,5,6..) so it can compair by the if statment
and i also want suppose if i have check one conddition than it shuold
not check again mean once it checked by script it should not check
again pl. need experts input..

thanks
nikunj

Re: comparision script

am 24.09.2007 13:00:54 von Vakayil Thobias

Nikunj Khakhar wrote:
> Hi,
>
>
>
> I am working on the Storage related script. i caputred following
> sample output :
> 69
> 00
> 13
> 00
> 00
> 00
> 00
> 00
> 00
> 00
> 00
> 02
> 27
>
> Above output is for the TIME (hour) of the snapshot i want the all
> values which Greter than 8 (hours)
> how can i compair above value with the 8 ( 00,01,02 values i want to
> convert in 1,2,3,4,5,6..) so it can compair by the if statment
> and i also want suppose if i have check one conddition than it shuold
> not check again mean once it checked by script it should not check
> again pl. need experts input..
>
> thanks
> nikunj
>

cat filename | awk '$1>08 {print $1}'

Re: comparision script

am 24.09.2007 13:52:32 von Janis Papanagnou

On 24 Sep., 13:00, Vakayil Thobias lucent.com> wrote:
> Nikunj Khakhar wrote:
> > Hi,
>
> > I am working on the Storage related script. i caputred following
> > sample output :
> > 69
> > 00
> > 13
> > 00
> > 00
> > 00
> > 00
> > 00
> > 00
> > 00
> > 00
> > 02
> > 27
>
> > Above output is for the TIME (hour) of the snapshot i want the all
> > values which Greter than 8 (hours)
> > how can i compair above value with the 8 ( 00,01,02 values i want to
> > convert in 1,2,3,4,5,6..) so it can compair by the if statment
> > and i also want suppose if i have check one conddition than it shuold
> > not check again mean once it checked by script it should not check
> > again pl. need experts input..
>
> > thanks
> > nikunj
>
> cat filename | awk '$1>08 {print $1}'

awk '$1>08' filename

(Cats and dogs have other partialities.)

Janis

Re: comparision script

am 24.09.2007 14:25:42 von Ed Morton

Janis wrote:
> On 24 Sep., 13:00, Vakayil Thobias > lucent.com> wrote:
>
>>Nikunj Khakhar wrote:
>>
>>>Hi,
>>
>>>I am working on the Storage related script. i caputred following
>>>sample output :
>>>69
>>>00
>>>13
>>>00
>>>00
>>>00
>>>00
>>>00
>>>00
>>>00
>>>00
>>>02
>>>27
>>
>>>Above output is for the TIME (hour) of the snapshot i want the all
>>>values which Greter than 8 (hours)
>>>how can i compair above value with the 8 ( 00,01,02 values i want to
>>>convert in 1,2,3,4,5,6..) so it can compair by the if statment
>>>and i also want suppose if i have check one conddition than it shuold
>>>not check again mean once it checked by script it should not check
>>>again pl. need experts input..
>>
>>>thanks
>>>nikunj
>>
>>cat filename | awk '$1>08 {print $1}'
>
>
> awk '$1>08' filename

Fore:

awk '$1>8' filename

> (Cats and dogs have other partialities.)
>
> Janis
>

Re: comparision script

am 24.09.2007 14:29:01 von Jobs Circular group

On Sep 24, 6:52 am, Janis wrote:
> On 24 Sep., 13:00, Vakayil Thobias >
>
>
>
>
> lucent.com> wrote:
> > Nikunj Khakhar wrote:
> > > Hi,
>
> > > I am working on the Storage related script. i caputred following
> > > sample output :
> > > 69
> > > 00
> > > 13
> > > 00
> > > 00
> > > 00
> > > 00
> > > 00
> > > 00
> > > 00
> > > 00
> > > 02
> > > 27
>
> > > Above output is for the TIME (hour) of the snapshot i want the all
> > > values which Greter than 8 (hours)
> > > how can i compair above value with the 8 ( 00,01,02 values i want to
> > > convert in 1,2,3,4,5,6..) so it can compair by the if statment
> > > and i also want suppose if i have check one conddition than it shuold
> > > not check again mean once it checked by script it should not check
> > > again pl. need experts input..
>
> > > thanks
> > > nikunj
>
> > cat filename | awk '$1>08 {print $1}'
>
> awk '$1>08' filename
>
> (Cats and dogs have other partialities.)
>
> Janis- Hide quoted text -
>
> - Show quoted text -

Thanks alll,

I got this output

1936
69
13
1739
27

than i want the full data for the above value because so how can i
get ?


than i want to

Re: comparision script

am 24.09.2007 14:31:48 von Ed Morton

Nikunj Khakhar wrote:

> On Sep 24, 6:52 am, Janis wrote:
>
>>On 24 Sep., 13:00, Vakayil Thobias >>
>>
>>
>>
>>
>>lucent.com> wrote:
>>
>>>Nikunj Khakhar wrote:
>>>
>>>>Hi,
>>
>>>>I am working on the Storage related script. i caputred following
>>>>sample output :
>>>>69
>>>>00
>>>>13
>>>>00
>>>>00
>>>>00
>>>>00
>>>>00
>>>>00
>>>>00
>>>>00
>>>>02
>>>>27
>>
>>>>Above output is for the TIME (hour) of the snapshot i want the all
>>>>values which Greter than 8 (hours)
>>>>how can i compair above value with the 8 ( 00,01,02 values i want to
>>>>convert in 1,2,3,4,5,6..) so it can compair by the if statment
>>>>and i also want suppose if i have check one conddition than it shuold
>>>>not check again mean once it checked by script it should not check
>>>>again pl. need experts input..
>>
>>>>thanks
>>>>nikunj
>>
>>>cat filename | awk '$1>08 {print $1}'
>>
>> awk '$1>08' filename
>>
>>(Cats and dogs have other partialities.)
>>
>>Janis- Hide quoted text -
>>
>>- Show quoted text -
>
>
> Thanks alll,
>
> I got this output
>
> 1936
> 69
> 13
> 1739
> 27

That's impossible given the sample input you posted.

> than i want the full data for the above value because so how can i
> get ?

Show us your real sample input and expected output.

Ed.

Re: comparision script

am 24.09.2007 14:45:56 von Jobs Circular group

On Sep 24, 7:31 am, Ed Morton wrote:
> Nikunj Khakhar wrote:
> > On Sep 24, 6:52 am, Janis wrote:
>
> >>On 24 Sep., 13:00, Vakayil Thobias >
> >>lucent.com> wrote:
>
> >>>Nikunj Khakhar wrote:
>
> >>>>Hi,
>
> >>>>I am working on the Storage related script. i caputred following
> >>>>sample output :
> >>>>69
> >>>>00
> >>>>13
> >>>>00
> >>>>00
> >>>>00
> >>>>00
> >>>>00
> >>>>00
> >>>>00
> >>>>00
> >>>>02
> >>>>27
>
> >>>>Above output is for the TIME (hour) of the snapshot i want the all
> >>>>values which Greter than 8 (hours)
> >>>>how can i compair above value with the 8 ( 00,01,02 values i want to
> >>>>convert in 1,2,3,4,5,6..) so it can compair by the if statment
> >>>>and i also want suppose if i have check one conddition than it shuold
> >>>>not check again mean once it checked by script it should not check
> >>>>again pl. need experts input..
>
> >>>>thanks
> >>>>nikunj
>
> >>>cat filename | awk '$1>08 {print $1}'
>
> >> awk '$1>08' filename
>
> >>(Cats and dogs have other partialities.)
>
> >>Janis- Hide quoted text -
>
> >>- Show quoted text -
>
> > Thanks alll,
>
> > I got this output
>
> > 1936
> > 69
> > 13
> > 1739
> > 27
>
> That's impossible given the sample input you posted.
>
> > than i want the full data for the above value because so how can i
> > get ?
>
> Show us your real sample input and expected output.
>
> Ed.- Hide quoted text -
>
> - Show quoted text -
$ cat snap_scr| grep -v Broken-off | grep -v Lag | awk '{print $4}' |
cut -f1 -d: |awk '$1>08'

1936

69

13

1739

27

27

I want to list the all fileds of the above value

Re: comparision script

am 24.09.2007 15:02:40 von Janis Papanagnou

On 24 Sep., 14:45, Nikunj Khakhar wrote:
> On Sep 24, 7:31 am, Ed Morton wrote:
>
> > Nikunj Khakhar wrote:
> > > On Sep 24, 6:52 am, Janis wrote:
>
> > >>On 24 Sep., 13:00, Vakayil Thobias >
> > >>lucent.com> wrote:
>
> > >>>Nikunj Khakhar wrote:
>
> > >>>>Hi,
>
> > >>>>I am working on the Storage related script. i caputred following
> > >>>>sample output :
> > >>>>69
> > >>>>00
> > >>>>13
> > >>>>00
> > >>>>00
> > >>>>00
> > >>>>00
> > >>>>00
> > >>>>00
> > >>>>00
> > >>>>00
> > >>>>02
> > >>>>27
>
> > >>>>Above output is for the TIME (hour) of the snapshot i want the all
> > >>>>values which Greter than 8 (hours)
> > >>>>how can i compair above value with the 8 ( 00,01,02 values i want to
> > >>>>convert in 1,2,3,4,5,6..) so it can compair by the if statment
> > >>>>and i also want suppose if i have check one conddition than it shuold
> > >>>>not check again mean once it checked by script it should not check
> > >>>>again pl. need experts input..
>
> > >>>>thanks
> > >>>>nikunj
>
> > >>>cat filename | awk '$1>08 {print $1}'
>
> > >> awk '$1>08' filename
>
> > >>(Cats and dogs have other partialities.)
>
> > >>Janis- Hide quoted text -
>
> > >>- Show quoted text -
>
> > > Thanks alll,
>
> > > I got this output
>
> > > 1936
> > > 69
> > > 13
> > > 1739
> > > 27
>
> > That's impossible given the sample input you posted.
>
> > > than i want the full data for the above value because so how can i
> > > get ?
>
> > Show us your real sample input and expected output.
>
> > Ed.- Hide quoted text -
>
> > - Show quoted text -
>
> $ cat snap_scr| grep -v Broken-off | grep -v Lag | awk '{print $4}' |
> cut -f1 -d: |awk '$1>08'
>
> 1936
>
> 69
>
> 13
>
> 1739
>
> 27
>
> 27
>
> I want to list the all fileds of the above value

It's not clear what you want. Please try to rephrase your task and
provide real sample input and expected output.

For now, whatever you need, you will be more flexible to re-write your
above command pipe...

> $ cat snap_scr| grep -v Broken-off | grep -v Lag | awk '{print $4}' |
> cut -f1 -d: |awk '$1>08'

....with awk...

awk '!/Broken-off/ && !/Lag/ { split($4,f,":"); if (f[1]>8) print }'
snap_scr

The above (untested!) will print the complete matching lines. If you
want specific fields use, e.g. for the fourth field, print $4 instead
of print.

Janis

Re: comparision script

am 24.09.2007 15:34:18 von gazelle

In article <1190638960.331736.27390@g4g2000hsf.googlegroups.com>,
Janis wrote:
....
>...with awk...
>
>awk '!/Broken-off/ && !/Lag/ { split($4,f,":"); if (f[1]>8) print }'
>snap_scr

!/Broken-off|Lag/ && split($4,f,":") && f[1]>8

Re: comparision script

am 24.09.2007 15:51:07 von Jobs Circular group

On Sep 24, 8:34 am, gaze...@xmission.xmission.com (Kenny McCormack)
wrote:
> In article <1190638960.331736.27...@g4g2000hsf.googlegroups.com>,Janis wrote:
>
> ...
>
> >...with awk...
>
> >awk '!/Broken-off/ && !/Lag/ { split($4,f,":"); if (f[1]>8) print }'
> >snap_scr
>
> !/Broken-off|Lag/ && split($4,f,":") && f[1]>8

Thanks all,

i got what i wanted i got o/p

usspna05a:/vol/usspbwp01Data01_na05a/san usspna06:/vol/
usspbwp01Data01/san_desta Source 69:16:50 Idle
usspna05a:/vol/usspbwp01Misc01_na05a/san usspna06:/vol/
usspbwp01Misc01/san_desta Source 13:20:54 Idle
usspna05a:saptranstest
usspna06:saptranstest Source
1739:39:54 Idle
usspna05a:/vol/usspbwp01Logs01_na05a/san uswdna01a:/vol/
usspbwp01Logs01_na05a/sandest Source 27:05:10 Transferring

i got using command : cat snap_scr | awk '!/Broken-off/ && !/Lag/
{ split($4,f,":"); if (f[1]>8) print }'



now i tried to capture second part i want minute part for example
69:16 in 4th column i wanted to capture minute "16" and compair only
if minute is gt than 10 than it should list all data with greter than
10 i tried to change in below command

cat snap_scr | awk '!/Broken-off/ && !/Lag/ { split($4,f,":"); if
(f[2]>10) print }'

but not working ... any suggestion.. plz././

Re: comparision script

am 24.09.2007 16:08:30 von Ed Morton

Nikunj Khakhar wrote:
> On Sep 24, 8:34 am, gaze...@xmission.xmission.com (Kenny McCormack)
> wrote:
>
>>In article <1190638960.331736.27...@g4g2000hsf.googlegroups.com>,Janis wrote:
>>
>>...
>>
>>
>>>...with awk...
>>
>>>awk '!/Broken-off/ && !/Lag/ { split($4,f,":"); if (f[1]>8) print }'
>>>snap_scr
>>
>>!/Broken-off|Lag/ && split($4,f,":") && f[1]>8
>
>
> Thanks all,
>
> i got what i wanted i got o/p
>
> usspna05a:/vol/usspbwp01Data01_na05a/san usspna06:/vol/
> usspbwp01Data01/san_desta Source 69:16:50 Idle
> usspna05a:/vol/usspbwp01Misc01_na05a/san usspna06:/vol/
> usspbwp01Misc01/san_desta Source 13:20:54 Idle
> usspna05a:saptranstest
> usspna06:saptranstest Source
> 1739:39:54 Idle
> usspna05a:/vol/usspbwp01Logs01_na05a/san uswdna01a:/vol/
> usspbwp01Logs01_na05a/sandest Source 27:05:10 Transferring
>
> i got using command : cat snap_scr | awk '!/Broken-off/ && !/Lag/
> { split($4,f,":"); if (f[1]>8) print }'
>
>
>
> now i tried to capture second part i want minute part for example
> 69:16 in 4th column i wanted to capture minute "16" and compair only
> if minute is gt than 10 than it should list all data with greter than
> 10 i tried to change in below command
>
> cat snap_scr | awk '!/Broken-off/ && !/Lag/ { split($4,f,":"); if
> (f[2]>10) print }'
>
> but not working ... any suggestion.. plz././
>

Yes - tell us in what way it's "not working" and, again, show some
sample input and expected output. And get rid of the UUOC:

Bad: cat file | awk '...'
Good: awk '...' file

Regards,

Ed.

Re: comparision script

am 24.09.2007 18:04:54 von Bill Marcum

On Mon, 24 Sep 2007 06:51:07 -0700, Nikunj Khakhar
wrote:
>
>
> On Sep 24, 8:34 am, gaze...@xmission.xmission.com (Kenny McCormack)
> wrote:
>> In article <1190638960.331736.27...@g4g2000hsf.googlegroups.com>,Janis wrote:
>>
>> ...
>>
>> >...with awk...
>>
>> >awk '!/Broken-off/ && !/Lag/ { split($4,f,":"); if (f[1]>8) print }'
>> >snap_scr
>>
>> !/Broken-off|Lag/ && split($4,f,":") && f[1]>8
>
> Thanks all,
>
> i got what i wanted i got o/p
>
> usspna05a:/vol/usspbwp01Data01_na05a/san usspna06:/vol/
> usspbwp01Data01/san_desta Source 69:16:50 Idle
> usspna05a:/vol/usspbwp01Misc01_na05a/san usspna06:/vol/
> usspbwp01Misc01/san_desta Source 13:20:54 Idle
> usspna05a:saptranstest
> usspna06:saptranstest Source
> 1739:39:54 Idle
> usspna05a:/vol/usspbwp01Logs01_na05a/san uswdna01a:/vol/
> usspbwp01Logs01_na05a/sandest Source 27:05:10 Transferring
>
> i got using command : cat snap_scr | awk '!/Broken-off/ && !/Lag/
> { split($4,f,":"); if (f[1]>8) print }'
>
In the data above it looks to me like the time is in $3.



--
* netgod opens his mailbox and immediately wishes he hadnt

Re: comparision script

am 26.09.2007 13:40:51 von Jobs Circular group

On Sep 24, 9:04 pm, Bill Marcum wrote:
> On Mon, 24 Sep 2007 06:51:07 -0700, Nikunj Khakhar
>
>
>
> wrote:
>
> > On Sep 24, 8:34 am, gaze...@xmission.xmission.com (Kenny McCormack)
> > wrote:
> >> In article <1190638960.331736.27...@g4g2000hsf.googlegroups.com>,Janis wrote:
>
> >> ...
>
> >> >...with awk...
>
> >> >awk '!/Broken-off/ && !/Lag/ { split($4,f,":"); if (f[1]>8) print }'
> >> >snap_scr
>
> >> !/Broken-off|Lag/ && split($4,f,":") && f[1]>8
>
> > Thanks all,
>
> > i got what i wanted i got o/p
>
> > usspna05a:/vol/usspbwp01Data01_na05a/san usspna06:/vol/
> > usspbwp01Data01/san_desta Source 69:16:50 Idle
> > usspna05a:/vol/usspbwp01Misc01_na05a/san usspna06:/vol/
> > usspbwp01Misc01/san_desta Source 13:20:54 Idle
> > usspna05a:saptranstest
> > usspna06:saptranstest Source
> > 1739:39:54 Idle
> > usspna05a:/vol/usspbwp01Logs01_na05a/san uswdna01a:/vol/
> > usspbwp01Logs01_na05a/sandest Source 27:05:10 Transferring
>
> > i got using command : cat snap_scr | awk '!/Broken-off/ && !/Lag/
> > { split($4,f,":"); if (f[1]>8) print }'
>
> In the data above it looks to me like the time is in $3.
>
> --
> * netgod opens his mailbox and immediately wishes he hadnt- Hide quoted text -
>
> - Show quoted text -

hello everyOne Thanks for the give me the good solution of my problem

I have one more query

I have three data
DATA,MISC and LOGS

by if...else i can compair the single value like

if [$DATA = 0]
else
do it
then
don do
fi

How can i use 3 variable using single if statmen which can compair if
value is zero or not ...

with regards,
nikunj