# code-block-pro/1.27.3/build/shiki/samples/awk.sample

Code Block Pro – Beautiful Syntax Highlighting, version 1.27.3. 25 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.27.3/code/build/shiki/samples/awk.sample
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.27.3/raw/build/shiki/samples/awk.sample
- Modified: 2022-08-22T22:25:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.27.3/code/build/shiki/samples/awk.sample#L10-L20`.

```
#!/bin/awk -f
BEGIN {
# How many lines
    lines=0;
    total=0;
}
{
# this code is executed once for each line
# increase the number of files
    lines++;
# increase the total size, which is field #1
    total+=$1;
}
END {
# end, now output the total
    print lines " lines read";
    print "total is ", total;
    if (lines > 0 ) {
	print "average is ", total/lines;
    } else {
	print "average is 0";
    }
}

#From https://www.grymoire.com/Unix/Awk.html
```
