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"
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
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