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/repos | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bin/repos') diff --git a/bin/repos b/bin/repos index 25f7725..2cb6987 100755 --- a/bin/repos +++ b/bin/repos @@ -77,15 +77,15 @@ arr_push() { ARR="$1" ELT="$2" if [ -n "$ARR" ]; then - echo "$ARR" + printf '%s\n' "$ARR" fi - echo "$ELT" # | array_encode (see CAVEAT) + printf '%s\n' "$ELT" # | array_encode (see CAVEAT) } arr_includes() { ARR="$1" ELT="$2" - echo "$ARR" | while read -r el; do + printf '%s\n' "$ARR" | while read -r el; do # if [ "$(printf '%s\n' "$el" | array_decode)" = "$ELT" ]; then (see CAVEAT) if [ "$el" = "$ELT" ]; then return 2 @@ -133,7 +133,7 @@ shift $((OPTIND - 1)) is_repository() { TYPE="$(vcs -C "$1" -t 2>/dev/null)" if [ -n "$TYPE" ]; then - echo "$1" + printf '%s\n' "$1" else return 1 fi -- cgit v1.2.3