]> _ Git - remote-logging.git/commitdiff
server: use printf for writing input to file (for logs, processes)
authormivirl <>
Sun, 3 Mar 2024 23:57:24 +0000 (17:57 -0600)
committermivirl <>
Sun, 3 Mar 2024 23:57:24 +0000 (17:57 -0600)
Switched to printf instead of echo to ensure that input lines are copied
as-is and escapes are ignored

src/server.sh

index 52e785a02d4356a178b101fadaf8f64503778d54..7fbd00e10a794471196ac2507c20b8d8bed8ed50 100644 (file)
@@ -26,7 +26,7 @@ write_to_file() {
         touch "$1"
         while IFS= read -r INPUT; do
             if [ "$INPUT" != "⟃---EOF---⟄" ]; then
-                echo "$INPUT" >> "$1"
+                printf "%s" "$INPUT" >> "$1"
             else
                 break
             fi