-
Notifications
You must be signed in to change notification settings - Fork 0
/
func.awk
52 lines (51 loc) · 794 Bytes
/
func.awk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@include "rev.awk"
BEGIN {
print "Beginning ..."
printWithColon(rev("Uzasne"))
print
assignArray(a, rev("Ale no\ttak"))
printArray(a)
# delarray(a)
# delete a
assignArray(a, "Baze")
printArray(a)
str = "global"
myfunc(str)
print str
print ret() "retez"
}
function ret() {
return
}
function myfunc(str)
{
print str
str = "zzz"
print str
}
function printWithColon(ret) {
if (ret == "")
ret = $0
printf "%s:", ret
return length(ret)
}
function assignArray(a, ret) {
split(ret, a, /\s/)
}
function printArray(a, i) {
for (i in a)
printf(a[i])
print
}
function delarray(a, i)
{
for (i in a)
delete a[i]
}
# /.+\s.+/ {
# print printWithColon()
# next
# }
# {
# print
# }