aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-06-10 16:19:28 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-06-10 16:19:28 +1200
commit491d52c57de52a1cdb15a8ee8fb66d97cdc34612 (patch)
treeb74b149a708f14610af4a88344329db7d78c85a7 /bin
parent87f3cf69ae310bdf83e262f5212847b3c764ced7 (diff)
downloaddotfiles-491d52c57de52a1cdb15a8ee8fb66d97cdc34612.tar.gz
dotfiles-491d52c57de52a1cdb15a8ee8fb66d97cdc34612.zip
Refactor urlh(1df) awk a bit
Diffstat (limited to 'bin')
-rw-r--r--bin/urlh.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/bin/urlh.sh b/bin/urlh.sh
index 5b5cab74..9f517fe9 100644
--- a/bin/urlh.sh
+++ b/bin/urlh.sh
@@ -17,13 +17,10 @@ unf |
sd2u |
# Use awk to find any values for the header case-insensitively
-awk -v header="$header" '
-BEGIN {
- FS=": *"
- header = tolower(header)
-}
+awk -F ': *' -v header="$header" '
+BEGIN { header = tolower(header) }
tolower($1) == header {
- sub(/^[^ ]*: */, "")
+ sub(/^[^:]*: */, "")
print
}
'