1
# gawk -f <source> [input1] ... [inputn]
4
############################################################################
5
# The 'awk' utility reads the input files one line at a time. For
6
# each line, 'awk' tries the patterns of each of the rules. If several
7
# patterns match then several actions are run, in the order in which they
8
# appear in the 'awk' program. If no patterns match, then no actions are
10
#############################################################################
13
/cgi/ { # Pattern accepts if current string contains "cgi" substring
14
$1 = "DL" # You can modify input string
15
print $0 # Prints current string
20
# This will be executed before processing files ( '{' Must been on some line )
22
print "Welcome To Hell!"
25
# This will be executed after processing files ( '{' Must been on some line )
35
# WARNING! Trying to supply function with RegExp parametr is dangerous, so
36
# func(/cgi/) will be translated as func($0 ~ /cgi/)