diff --git a/validate_workflow.sh b/validate_workflow.sh
index 6b2b5e6227f28d3fcfd8c95f2b37bc78f88416a3..217387087d1660f5f96e1b92d9884242051e2c49 100755
--- a/validate_workflow.sh
+++ b/validate_workflow.sh
@@ -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"
 }