diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-11 00:09:24 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-11 00:09:24 +1300 |
commit | 960208a496240318b38a6a6cfdf1f5e266099c85 (patch) | |
tree | de7ff197a3514d3e0bcfa6acbfa748b2738c5692 /bin/sec.awk | |
parent | Remove superfluous calls to next in sec(1df) (diff) | |
download | dotfiles-960208a496240318b38a6a6cfdf1f5e266099c85.tar.gz dotfiles-960208a496240318b38a6a6cfdf1f5e266099c85.zip |
Stylistic tweaks to awk scripts
Diffstat (limited to 'bin/sec.awk')
-rw-r--r-- | bin/sec.awk | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/bin/sec.awk b/bin/sec.awk index cac40cb9..3ebf02b6 100644 --- a/bin/sec.awk +++ b/bin/sec.awk @@ -12,21 +12,13 @@ BEGIN { FS = ":0*" } } # Match hh:mm:ss -NF == 3 { - printf "%u\n", $1 * 3600 + $2 * 60 + $3 -} +NF == 3 { printf "%u\n", $1 * 3600 + $2 * 60 + $3 } # Match mm:ss -NF == 2 { - printf "%u\n", $1 * 60 + $2 -} +NF == 2 { printf "%u\n", $1 * 60 + $2 } # Match ss (in which case all we've done is strip zeroes) -NF == 1 { - printf "%u\n", $1 -} +NF == 1 { printf "%u\n", $1 } # Done, exit 1 if we had any errors on the way -END { - exit(err > 0) -} +END { exit(err > 0) } |