From 060c814e1e263edb0d7f4c614460697391ad2911 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 23 Jan 2017 01:16:57 +1300 Subject: Swap pph(1df) sed(1) subst for awk(1) concat Technically safer; regex metacharacters in the hostname (!) would break the sed. --- bin/pph | 4 ++-- 1 file 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 }' -- cgit v1.2.3