Fix the following shellcheck SC2295 warnings,
In kdump-lib.sh line 177:
_path=${1#$_mnt}
^---^ SC2295 (info): Expansions inside ${..} need to be quoted
separately, otherwise they match as patterns.
Did you mean:
_path=${1#"$_mnt"}
In kdump-lib.sh line 194:
_fsroot=${_src#${_src_nofsroot}[}
^--------------^ SC2295 (info): Expansions inside ${..} need to
be quoted separately, otherwise they match as patterns.
Did you mean:
_fsroot=${_src#"${_src_nofsroot}"[}
In kdump-lib.sh line 203:
_fsroot=${_fsroot#$_subvol}
^------^ SC2295 (info): Expansions inside ${..} need
to be quoted separately, otherwise they match as patterns.
Did you mean:
_fsroot=${_fsroot#"$_subvol"}
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdump-lib.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index c5bee02..9a5320d 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -174,7 +174,7 @@ get_bind_mount_source()
local _fsroot _src_nofsroot
_mnt=$(df "$1" | tail -1 | awk '{print $NF}')
- _path=${1#$_mnt}
+ _path=${1#"$_mnt"}
_src=$(get_mount_info SOURCE target "$_mnt" -f)
_opt=$(get_mount_info OPTIONS target "$_mnt" -f)
@@ -191,7 +191,7 @@ get_bind_mount_source()
echo "$_mnt$_path" && return
fi
- _fsroot=${_src#${_src_nofsroot}[}
+ _fsroot=${_src#"${_src_nofsroot}"[}
_fsroot=${_fsroot%]}
_mnt=$(get_mount_info TARGET source "$_src_nofsroot" -f)
@@ -200,7 +200,7 @@ get_bind_mount_source()
local _subvol
_subvol=${_opt#*subvol=}
_subvol=${_subvol%,*}
- _fsroot=${_fsroot#$_subvol}
+ _fsroot=${_fsroot#"$_subvol"}
fi
echo "$_mnt$_fsroot$_path"
}
--
2.37.1