aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-23 01:16:57 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-23 01:16:57 +1300
commit060c814e1e263edb0d7f4c614460697391ad2911 (patch)
tree375a6f912def7cb81460660636d52cca2749447b /bin
parentChange htref(1df) into proper source format (diff)
downloaddotfiles-060c814e1e263edb0d7f4c614460697391ad2911.tar.gz
dotfiles-060c814e1e263edb0d7f4c614460697391ad2911.zip
Swap pph(1df) sed(1) subst for awk(1) concat
Technically safer; regex metacharacters in the hostname (!) would break the sed.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pph4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/pph b/bin/pph
index 684aaafd..7987382f 100755
--- a/bin/pph
+++ b/bin/pph
@@ -1,5 +1,5 @@
#!/bin/sh
# Run pp(1df) on args, prefix with machine hostname
-hostname=$(hostname -s) || exit
+hn=$(hostname -s) || exit
pp "$@" |
-sed 's_^_'"$hostname":'_'
+awk -v hn="$hn" '{ print hn ":" $0 }'