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. --- etc/sh/rc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'etc/sh/rc') diff --git a/etc/sh/rc b/etc/sh/rc index bcd3b02e..3785d30f 100644 --- a/etc/sh/rc +++ b/etc/sh/rc @@ -121,7 +121,7 @@ export VG_FLAGS=' --track-origins=yes --error-exitcode=1 ' -VG_FLAGS="$(echo "$VG_FLAGS" | grep . | tr -d '\t' | tr '\n' ' ')" +VG_FLAGS="$(printf '%s\n' "$VG_FLAGS" | grep . | tr -d '\t' | tr '\n' ' ')" export CFLAGS=' -D_POSIX_C_SOURCE=200809L @@ -144,7 +144,7 @@ export CFLAGS=' -g -Werror ' -CFLAGS="$(echo "$CFLAGS" | grep . | tr -d '\t' | tr '\n' ' ')" +CFLAGS="$(printf '%s\n' "$CFLAGS" | grep . | tr -d '\t' | tr '\n' ' ')" export CC=gcc export LEIN_SUPPRESS_USER_LEVEL_REPO_WARNINGS=1 export LEIN_HOME="$XDG_CONFIG_HOME"/leiningen @@ -363,8 +363,8 @@ g() { )" rm -f "$(dirname "$PAT")"/*-g-shell-function if [ -n "$LINE" ]; then - FILE="$( echo "$LINE" | cut -d: -f1)" - NUMBER="$(echo "$LINE" | cut -d: -f2)" + FILE="$( printf '%s\n' "$LINE" | cut -d: -f1)" + NUMBER="$(printf '%s\n' "$LINE" | cut -d: -f2)" case "$1" in "'"*"'") # Best effort handling of string escaping, since -- cgit v1.3