From 07455024c72c3aa0bacf8338b82d3a0b8a96a9b0 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 4 Jan 2024 11:23:50 -0300 Subject: re "s|echo \"\\\$|printf '%s\\\n' \"\$|g" Replace all cases where `echo` was given a variable as its first argument, even on cases where we always know what the variable's content look like. --- bin/muffle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/muffle') diff --git a/bin/muffle b/bin/muffle index 6f93306..35d1ee6 100755 --- a/bin/muffle +++ b/bin/muffle @@ -83,10 +83,10 @@ STATUS="$(cat "$STATUS_F")" if [ "$STATUS" != 0 ]; then cat "$OUT" "$ERR" | sort -k2 | while read -r line; do - if [ "$(echo "$line" | cut -d' ' -f1)" = 'out:' ]; then - echo "$line" | cut -d' ' -f3- >&1 + if [ "$(printf '%s\n' "$line" | cut -d' ' -f1)" = 'out:' ]; then + printf '%s\n' "$line" | cut -d' ' -f3- >&1 else - echo "$line" | cut -d' ' -f3- >&2 + printf '%s\n' "$line" | cut -d' ' -f3- >&2 fi done exit "$STATUS" -- cgit v1.2.3