]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fix(SC2164): robust `cd` conditional
authorEisuke Kawashima <e-kwsm@users.noreply.github.com>
Mon, 14 Jul 2025 08:10:59 +0000 (17:10 +0900)
committerEisuke Kawashima <e-kwsm@users.noreply.github.com>
Mon, 14 Jul 2025 11:24:26 +0000 (20:24 +0900)
shell-completion/bash/kernel-install

index 9d20b2fd055db163d25a9baf21b84bc8a33f391e..70e9906e6ca23c954a9ce3f33c5818ebb8682624 100644 (file)
@@ -36,11 +36,11 @@ _kernel_install() {
             comps="add remove"
             ;;
         2)
-            comps=$(cd /lib/modules; echo [0-9]*)
+            comps=$(cd /lib/modules && echo [0-9]*)
             if [[ ${COMP_WORDS[1]} == "remove" ]] && [[ -f /etc/machine-id ]]; then
                 read -r MACHINE_ID < /etc/machine-id
                 if [[ $MACHINE_ID ]] && ( [[ -d /boot/$MACHINE_ID ]] || [[ -L /boot/$MACHINE_ID ]] ); then
-                    comps=$(cd "/boot/$MACHINE_ID"; echo [0-9]*)
+                    comps=$(cd "/boot/$MACHINE_ID" && echo [0-9]*)
                 fi
             fi
             ;;