From dfe7555323e22d3f23621fcdae11b2c467754175 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Wed, 4 Aug 2021 15:51:34 +0800 Subject: [PATCH] dracut-module-setup.sh: fix a ambiguous variable reference Wrap the variable with {...}, else it may get interpreted as array due to the '[' char next to it. Signed-off-by: Kairui Song Acked-by: Philipp Rudo --- dracut-module-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 3d465c4..8b0398a 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -689,11 +689,11 @@ kdump_install_conf() { case "$_opt" in raw) _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev $_val) - sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf + sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf ;; ext[234]|xfs|btrfs|minix) _pdev=$(kdump_get_persistent_dev $_val) - sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf + sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf ;; ssh|nfs) kdump_install_net "$_val"