From d22bd48e8cfc7898d078b5aa480562b342d7f138 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 25 May 2016 14:48:37 +0200 Subject: [PATCH] fix(wrapper.sh): Redirect stderr to both file and stdout --- scripts/lemonbuddy_wrapper.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/lemonbuddy_wrapper.sh b/scripts/lemonbuddy_wrapper.sh index 7bff0f58..7429baaa 100755 --- a/scripts/lemonbuddy_wrapper.sh +++ b/scripts/lemonbuddy_wrapper.sh @@ -24,6 +24,8 @@ pipe="$(mktemp -u /tmp/lemonbuddy.in.XXXXX)" [ -d "$logdir" ] || mkdir -p "$logdir" +exec 2> >(tee "$logfile") + mkfifo "$pipe" cleanup_proc() { @@ -35,7 +37,7 @@ cleanup_proc() { } # shellcheck disable=SC2094 -{ lemonbuddy "$@" -p "$pipe" 2>"$logfile"; kill -TERM $$ 2>/dev/null; } | $lemonbar >"$pipe" & +{ lemonbuddy "$@" -p "$pipe"; kill -TERM $$ 2>/dev/null; } | $lemonbar >"$pipe" & trap 'cleanup_proc $!' TERM INT