From 6968a933439036e7cc4f5540f0ec40e0fd346a1f Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Sat, 22 Aug 2026 00:47:14 +0200 Subject: [PATCH] style: Normalize variable expansions in libs.deprecated/* These files stay deprecated and out of the sourcing path for now, but apply the same ${var} notation cleanup as the rest of the repo where it's a pure notation fix. basedir.bash is left untouched: its bug is a broken escape, not a notation issue, and it mirrors the one already removed from _helpers.bash. --- libs.deprecated/grepp.bash | 2 +- libs.deprecated/ldif.bash | 2 +- libs.deprecated/path.bash | 4 ++-- libs.deprecated/prompt_command.bash | 4 ++-- libs.deprecated/virtualization.bash | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs.deprecated/grepp.bash b/libs.deprecated/grepp.bash index 6e773e7..1cb57d5 100755 --- a/libs.deprecated/grepp.bash +++ b/libs.deprecated/grepp.bash @@ -1 +1 @@ -grepp() { x=$1; shift; perl -00ne ' print if /'"$x"'/i ' "$*" ; } +grepp() { x=$1; shift; perl -00ne ' print if /'"${x}"'/i ' "$*" ; } diff --git a/libs.deprecated/ldif.bash b/libs.deprecated/ldif.bash index 6839f53..9bfde65 100644 --- a/libs.deprecated/ldif.bash +++ b/libs.deprecated/ldif.bash @@ -12,5 +12,5 @@ function ldifparse () if (length) print next } - {print}' "$FILE" + {print}' "${FILE}" } diff --git a/libs.deprecated/path.bash b/libs.deprecated/path.bash index 2fa4c10..ea34809 100644 --- a/libs.deprecated/path.bash +++ b/libs.deprecated/path.bash @@ -1,8 +1,8 @@ #!/bin/bash _path_add() { - if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then - PATH="${PATH:+"$PATH:"}$1" + if [ -d "$1" ] && [[ ":${PATH}:" != *":$1:"* ]]; then + PATH="${PATH:+"${PATH}:"}$1" fi } diff --git a/libs.deprecated/prompt_command.bash b/libs.deprecated/prompt_command.bash index ebc0d31..692c99a 100644 --- a/libs.deprecated/prompt_command.bash +++ b/libs.deprecated/prompt_command.bash @@ -1,8 +1,8 @@ #!/bin/bash _prompt_command_add() { - if [ -n "$1" ] && [[ ":$PROMPT_COMMAND:" != *":$1:"* ]]; then - PROMPT_COMMAND="${PROMPT_COMMAND:+"$PROMPT_COMMAND;"}$1" + if [ -n "$1" ] && [[ ":${PROMPT_COMMAND}:" != *":$1:"* ]]; then + PROMPT_COMMAND="${PROMPT_COMMAND:+"${PROMPT_COMMAND};"}$1" fi } diff --git a/libs.deprecated/virtualization.bash b/libs.deprecated/virtualization.bash index bf8b5c0..5593ab5 100755 --- a/libs.deprecated/virtualization.bash +++ b/libs.deprecated/virtualization.bash @@ -188,7 +188,7 @@ vm_create_magick2() { template=${3} # Define ressources based on template - case $template in + case ${template} in small) vcpus="1,maxvcpus=2" memory="1024,maxmemory=2048" @@ -262,7 +262,7 @@ _hypervisors() { if [ -e ~/.ssh/known_hosts ]; then known_hypervisors=$(cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e 's/,.*//g' | grep -v "\[" | grep -i hypervisor | uniq) fi - echo $configured_hypervisors $known_hypervisors + echo "${configured_hypervisors}" "${known_hypervisors}" } #complete -W "$(cat ~/.ssh/config | egrep -i "^\s*host\s+[a-zA-Z]" | sed -e "s/^host\s*//i" | grep -i hypervisor)" hypervisor_connect