diff options
-rwxr-xr-x | tests/vm-check.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/vm-check.sh b/tests/vm-check.sh index e6b4af4..695e4d7 100755 --- a/tests/vm-check.sh +++ b/tests/vm-check.sh @@ -76,12 +76,23 @@ eval "$(assert-arg -- "${REMOTE:-}" '-r REMOTE')" SEP="$(color -c blacki ':')" + +pre() { + # Same as: + # sed -u "s|^|[$CMD]: |" + # but the "-u" option is not POSIX + IFS='' + while read -r line; do + printf '%s%s\n' "$1" "$line" + done +} + pre_guest() { - sed -u "s|^|$(color -c green "$HOST")$SEP$(color -c yellow "$TYPE")$SEP |" + pre "$(color -c green "$HOST")$SEP$(color -c yellow "$TYPE")$SEP " } pre_host() { - sed -u "s|^|$(color -c blueb "$0")$SEP |" + pre "$(color -c blueb "$0")$SEP " } STATUS_F="$(mkstemp)" |