Will come to this lecture about Alk. great oak we can take our scripts to next level as you will see
later.
But what is an org.
It is a program that searches files for lines that contain certain patterns and then performs operation
describe in all body on line with that button.
Or we can use awk to perform some operation on the chosen line.
And now we can see basic structure of all.
It is pretty simple.
We are starting with keyboard awk.
Then we specify what operations we want to happen on each line of specific files.
And what is the structure of that operations you would like to execute for each line.
It is divided into three parts.
First section is BEGIN section and everything you type here will be executed before performing operations
on each line of a specific file.
Next section is the most important one.
This section will be executed for each line of specific file and the last section ISDE and section despiser
is executed after org processed all lines of a specific file.
Here is some examples how the code looks like.
Notice that we don't specify file names here but instead we want the awk program to be run just for
a specific line for specific output of each month.
So what is happening here.
Firstly output of eco command is used as an input into our program.
Then the org executes commands in the BEGIN section then commands in main they are performed for output
of eco command.
And finally because we don't have more lines more inputs the N.S. is better from we can of course use
only one section of our program as we can see here.
Here we don't have BEGIN and END section we only performing the main section for specific output from
eco command in awk program best features doesn't work.
And what's more important if we are using a completely new language in all body for example we don't
use eco but mainly we are using print command.
We have also different structure of if our statement and the same is for for loop and many more and
more is also new for us.
If we have completely new features available we can call for specific lines.
For example we have here variable an F which represents number of fields.
Then we have an R which represents number of records and so on.
I can feel that this short arc summary may sound hard and difficult for you but please check for following
lectures where we will focus on each part of all programming and you will find it quite easy.
We're going step by step.