Commit 8e0db7bb authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-sh-functions: rewrite store_output without using bash's PIPESTATUS

parent 272b7c5b
...@@ -163,15 +163,19 @@ store_output() ...@@ -163,15 +163,19 @@ store_output()
{ {
# use make_temp_file from etersoft-build-utils # use make_temp_file from etersoft-build-utils
RC_STDOUT=$(mktemp) RC_STDOUT=$(mktemp)
local CMDSTATUS=$RC_STDOUT.pipestatus
echo 1 >$CMDSTATUS
#RC_STDERR=$(mktemp) #RC_STDERR=$(mktemp)
"$@" 2>&1 | tee $RC_STDOUT ( "$@" 2>&1 ; echo $? >$CMDSTATUS ) | tee $RC_STDOUT
return $(cat $CMDSTATUS)
# bashism
# http://tldp.org/LDP/abs/html/bashver3.html#PIPEFAILREF # http://tldp.org/LDP/abs/html/bashver3.html#PIPEFAILREF
return $PIPESTATUS #return $PIPESTATUS
} }
clean_store_output() clean_store_output()
{ {
rm -f $RC_STDOUT rm -f $RC_STDOUT $RC_STDOUT.pipestatus
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment