http://3wymlmcsvxiaqzmbepsdawqpk6o2qsk65jhms72qqjulk5u4bgmvs3qd.onion/fuss/awk
One example application would be creating a JSON object out of the status of an APC UPS: apcaccess | awk -F: '
function trim(s) {
return gensub(/^[ \t " ]*|[ \t " ]*$/, " " , " g " , s)
}
BEGIN {
printf " { " }
NR > 1 {
printf( " , " )
}
{
printf( " \ " %s\ " :\ " %s\ " " , trim($1), trim(substr($0, index($0, " : " ) + 1)));
}
END {
print " } " }
' Netstat with Awk From qistoph...