Bug: Set rights for client sw
split function elog_add_command_subshell and elog_add_command
This commit is contained in:
@@ -41,8 +41,18 @@ elog_add() {
|
||||
echo $@ | tee ${LOGFILE} -a
|
||||
}
|
||||
elog_add_command() {
|
||||
#Run a command, capture all output (STD and ERR) to the logfile AND in variable RETTXT AND output to screen
|
||||
#Run a command, capture output (STD and ERR) to the logfile AND in variable RETTXT AND output to screen
|
||||
#Returns the exit value of the command in $? and in RETNO
|
||||
RETTXT=$( $@ > >(tee -a ${LOGFILE}) 2>&1 )
|
||||
RETNO=$?
|
||||
echo "${RETTXT}"
|
||||
return ${RETNO}
|
||||
}
|
||||
elog_add_command_subshell() {
|
||||
# Special Version of above, where the command will be completely executed in a subshell. This is needed for some commands, that may output to
|
||||
# something else than STD or ERR and otherwise cannot be captured completely.
|
||||
# Benefit: Really catch everything that is send to output
|
||||
# Disadvantage: Output wont't display directly, but only after finshed execution
|
||||
RETTXT=$( { $@ > >(tee -a ${LOGFILE}); } 2> >(tee -a ${LOGFILE}) )
|
||||
RETNO=$?
|
||||
echo "${RETTXT}"
|
||||
|
||||
Reference in New Issue
Block a user