diff --git a/debian/scripts/koha-foreach b/debian/scripts/koha-foreach index 9cf150d811..6bda4143bd 100755 --- a/debian/scripts/koha-foreach +++ b/debian/scripts/koha-foreach @@ -32,9 +32,14 @@ done for name in $(koha-list $listopts) do + ( + exec 3>&1 sudo -u "$name-koha" \ env PERL5LIB=/usr/share/koha/lib \ KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \ - "$@" + "$@" 2>&1 >&3 | sed -e "s/^/$name: /" >&2 3>&- + exec 3>&- + ) | sed -e "s/^/$name: /" + done