Change awk to gawk
authorCase Duckworth <acdw@acdw.net>
Sun, 24 May 2020 00:48:49 +0000 (19:48 -0500)
committerCase Duckworth <acdw@acdw.net>
Sun, 24 May 2020 00:48:49 +0000 (19:48 -0500)
bollux

diff --git a/bollux b/bollux
index ab9e76b..29bda1e 100755 (executable)
--- a/bollux
+++ b/bollux
@@ -212,8 +212,8 @@ handle() { # handle URL < RESPONSE
        while read -d $'\r' -r head; do
                break # wait to read the first line
        done
-       code="$(awk '{print $1}' <<<"$head")"
-       meta="$(awk '{for(i=2;i<=NF;i++)printf "%s ",$i;printf "\n"}' <<<"$head")"
+       code="$(gawk '{print $1}' <<<"$head")"
+       meta="$(gawk '{for(i=2;i<=NF;i++)printf "%s ",$i;printf "\n"}' <<<"$head")"
 
        log 5 "[$code]  $meta"
 
@@ -290,7 +290,7 @@ display() { # display MIMETYPE < DOCUMENT
        case "$mimetype" in
        text/*)
                # normalize line endings to "\n"
-               # awk 'BEGIN{RS=""}{gsub(/\r\n?/,"\n");print}'
+               # gawk 'BEGIN{RS=""}{gsub(/\r\n?/,"\n");print}'
                cat
                # TODO: use less with linking and stuff
                # less -R -p'^=>' +g
@@ -356,7 +356,7 @@ bollux_cleanup() {
 if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
        set -euo pipefail # strict mode
        # requirements here -- so they're only checked once
-       require awk
+       require gawk
        require dd
        require mv
        require openssl