run_command2.sh 337 Bytes
Newer Older
Vitaly Lipatov's avatar
Vitaly Lipatov committed
1 2 3 4 5 6 7 8 9 10
#!/bin/sh

run_command()
{
    # use make_temp_file from etersoft-build-utils
    RC_STDOUT=$(mktemp)
    #RC_STDERR=$(mktemp)
    $1 2>&1 | tee $RC_STDOUT
}

11 12 13 14 15
return_big()
{
    return 2021
}

Vitaly Lipatov's avatar
Vitaly Lipatov committed
16 17 18 19 20 21 22 23 24 25
func()
{
    echo STDERR >&2
    echo STDOUT
}

run_command func
cat $RC_STDOUT
#cat $RC_STDERR
rm -f $RC_STDOUT $RC_STDERR
26 27 28

return_big
echo $?