Tag: awk
The apache server logs the access requests in /var/log/apache2 so we can analyse this log file to find out the last few requests. The following parses the apache2 server …
On Linux, we can cat the file “/proc/meminfo” to display memory related information: $ cat /proc/memoinfo MemTotal: 32939372 kB MemFree: 31155452 kB MemAvailable: 31269760 kB Buffers: 242964 kB Cached: …
Based on the calc function defined in BASH via AWK, we can perform floating point computation in BASH. The $RANDOM variable gives a psuedo random integer that is within …
The inbuilt BASH does not support floating point arithmetic calculations but we can easily declare a function to do so via AWK. #!/bin/bash # calc.sh function calc() { awk …
The following BASH script uses the ping command and computes the average PING to a domain via awk text processing. #!/bin/bash if ]; then echo Usage: $0 domain exit …