Files
Makefile-tutorial/AWK.txt
Hizenberg469 fd1b1511c8 New Makefile
2024-11-30 15:40:14 +05:30

37 lines
937 B
Plaintext

AWK
* searches files for lines that contain certain pattern
* performs operation described in AWK body on line with certain
pattern.
* performs operation described in AWK body on choosen line
* Basic structure
awk 'program_you_will_write' input-file1 input-file2
awk 'BEGIN{
code_in_BEGIN_section
}
{ code_in_main_body_section }
END{
code_in_END_section
}' input-file1 input-file2
* AWK Commands
* In AWK body bash features doesn't work
* Completely new language in AWK body
* print
* if-else
* for loop
* ...
* Completely new features we can call on specific line (specific text)
* NF (number of fields)
* NR (number of records)
* RS (records separator)
* $1,$2,.. (specific fields)
* ...