From c30847c1f5ed3786a98a67eec4a9a534165f1ee6 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Wed, 22 Feb 2023 03:47:06 +0100 Subject: [PATCH] #48: Stop relying on `echo`, `tee` and `/dev/null` for redirecting compression command to `debug/` --- main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index e9d3300..0fcebc0 100644 --- a/main.cpp +++ b/main.cpp @@ -684,7 +684,9 @@ void exec(unsigned short threadId, string cmd, bool debug) debugErrFilePath = debugCommonFilePath + ".err"; cmd += " >> " + debugOutFilePath; cmd += " 2>> " + debugErrFilePath; - cmd += "; echo \"" + initialCmd + "\" | tee -a " + debugOutFilePath + " " + debugErrFilePath + " > /dev/null"; + + writeFile(threadId, debugOutFilePath, "a", initialCmd + "\n"); + writeFile(threadId, debugErrFilePath, "a", initialCmd + "\n"); } system(cmd.c_str()); }