Hi,
I am trying to do script that helps me to filter the following file:
udp/rtp 160 c8 6051 11453920 955869701
udp/rtp 160 c8 12264 1962240 915475809
udp/rtp 160 c8 1461 233760 1811723741
udp/rtp 160 c8 19655 3144800 2138545229
udp/rtp 160 c8 5513 967520 270979107
udp/rtp 160 c8 1800 406080 401604270
udp/rtp 160 c8 6052 11454080 955869701
udp/rtp 160 c8 6053 11454240 955869701
#!/bin/sh
awk '{$6 == "955869701"; {print $0}}'
and the result is:
udp/rtp 160 c8 6051 11453920 955869701
udp/rtp 160 c8 6052 11454080 955869701
udp/rtp 160 c8 6053 11454240 955869701
but I want to do scrit in which it is a variable instead of the chain, in order to obtain the same result, for example:
#!/bin/sh
awk '{ssrc=$6; {if (ssrc == oldssrc) {print $0}}oldssrc=ssrc;}'
but it doesn't work
Please anybody can help me
Thanks
I am trying to do script that helps me to filter the following file:
udp/rtp 160 c8 6051 11453920 955869701
udp/rtp 160 c8 12264 1962240 915475809
udp/rtp 160 c8 1461 233760 1811723741
udp/rtp 160 c8 19655 3144800 2138545229
udp/rtp 160 c8 5513 967520 270979107
udp/rtp 160 c8 1800 406080 401604270
udp/rtp 160 c8 6052 11454080 955869701
udp/rtp 160 c8 6053 11454240 955869701
#!/bin/sh
awk '{$6 == "955869701"; {print $0}}'
and the result is:
udp/rtp 160 c8 6051 11453920 955869701
udp/rtp 160 c8 6052 11454080 955869701
udp/rtp 160 c8 6053 11454240 955869701
but I want to do scrit in which it is a variable instead of the chain, in order to obtain the same result, for example:
#!/bin/sh
awk '{ssrc=$6; {if (ssrc == oldssrc) {print $0}}oldssrc=ssrc;}'
but it doesn't work
Please anybody can help me
Thanks