nawk code explanation

Hi
I have a line/command which greps certain pattern ([435]) from the file and 22 lines AFTER that:

nawk '/\[435\]/{c=22}c&&c--' input_file

Can somebody explain the coding in this command (what " c&&c-- " does)? and how to modify this command to output 22 lines BEFORE this pattern ([435]) Thanks a lot -A

in your code first it search for pattern if its found it sets c to 22
then it decrement the value of c untill 22&&0 becomes 0 and exit

you can use this awk to print either above or below or both lines from pattern

awk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=3 a=5 s="pattern" filename

b-->no of lines above the pattern
a-->no of line below the pattern

explination:-

if you find [435] set c 22 end.
if c is true (meaning c > 0) and c-- (c=c-1) is also true print $0 ($0 is all the line) end.

BR

Thnks a lot guys !