mirror of
https://github.com/Hizenberg469/Makefile-tutorial.git
synced 2026-04-19 22:02:24 +03:00
New Makefile
This commit is contained in:
37
AWK.txt
Normal file
37
AWK.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
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)
|
||||
* ...
|
||||
Reference in New Issue
Block a user