Skip to content
Snippets Groups Projects
Commit 08ee3635 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- bugfix, if pipe mode, print result to stdout instead file

parent 30ea5e8a
No related branches found
No related tags found
No related merge requests found
......@@ -363,7 +363,11 @@ exec_cmd() {
local stop_t
start_t=$(date +"%s")
debug "scan_file, calling cmd='$cmd'"
$cmd >>"$log" 2>&1
if [ -n "$log" ]; then
$cmd >>"$log" 2>&1
else
$cmd 2>&1
fi
local is_valid=$?
stop_t=$(date +"%s")
local duration=$((stop_t - start_t))
......@@ -393,7 +397,11 @@ handle_input_if_requested() {
get_logfile() {
local filename=$1
local logname
logname=$(echo "$filename"| sed -e "s#^${WATCH_FOLDER}#${RESULT_FOLDER}#" -e "s#\$#.log#")
if [ -n "${WATCH_FOLDER}" ] && [ "${WITH_PIPE}" -eq 0 ]; then
logname=$(echo "$filename"| sed -e "s#^${WATCH_FOLDER}#${RESULT_FOLDER}#" -e "s#\$#.log#")
else # pipe uses a temp filename
logname=""
fi
debug "get_logfile, logname=$logname (filename=$filename)"
echo "$logname"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment