The BEGIN section is a section of code awk reads before it reads any files.
It is not running shell code, which is why it looks so different, it's running awk code, it's its own language.
for (y=yc; y<=yb; y++) { x = a2*y*y+b2*y+c2; print x, y };
If yc=0 and yb=4, it loops 5 times, with y=0, y=1, y=2, y=3, y=4, y=5, following the mathematical formula given to calculate new results for x, then prints the coordinates.
No - your mixing up shell and awk , a program.
pointsb is a shell variable. The `...` is the old, deprecated form of command substitution. awk is the program being called, the -v... s are awk-variable-definitions used to transfer shell variables to awk variables, the literal string '...' is an awk script, and finally the awk output is being assigned to pointsb.
Your replies saved lot of time in learning shell script and made life easier
I downloaded Fedora 19
I installed it in my laptop
I created that simple shell script and executed to know the pointsb value with some dummy values of other variables
I created another shell script without awk
pointsb = ""
for (y=yc; y<=yb; y++) {
x = a2*y*y+b2*y+c2;
pointsb = "$pointsb $x $y "
}
The logic is completely right in the above code apart from the system mistakes. I am sure i am not going to write any shell script. I just wanted to learn it. So when i read a script, i could understand the flow.