1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

fsadm: shellcheck prefer explicit escaping

Backslash is literal in "\t". Prefer explicit escaping: "\\t".
This commit is contained in:
Zdenek Kabelac 2018-03-23 15:53:36 +01:00
parent fe69731d31
commit cafcc5813a

View File

@ -311,10 +311,10 @@ detect_mounted_with_proc_self_mountinfo() {
# device (which could have been renamed). # device (which could have been renamed).
# We need to visit every mount point and check it's major minor # We need to visit every mount point and check it's major minor
detect_mounted_with_proc_mounts() { detect_mounted_with_proc_mounts() {
MOUNTED=$("$GREP" "^$VOLUME[ \t]" "$PROCMOUNTS") MOUNTED=$("$GREP" "^$VOLUME[ \\t]" "$PROCMOUNTS")
# for empty string try again with real volume name # for empty string try again with real volume name
test -z "$MOUNTED" && MOUNTED=$("$GREP" "^$RVOLUME[ \t]" "$PROCMOUNTS") test -z "$MOUNTED" && MOUNTED=$("$GREP" "^$RVOLUME[ \\t]" "$PROCMOUNTS")
MOUNTDEV=$(echo -n -e "${MOUNTED%% *}") MOUNTDEV=$(echo -n -e "${MOUNTED%% *}")
# cut device name prefix and trim everything past mountpoint # cut device name prefix and trim everything past mountpoint
@ -325,8 +325,8 @@ detect_mounted_with_proc_mounts() {
# for systems with different device names - check also mount output # for systems with different device names - check also mount output
if test -z "$MOUNTED" ; then if test -z "$MOUNTED" ; then
# will not work with spaces in paths # will not work with spaces in paths
MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$VOLUME[ \t]") MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$VOLUME[ \\t]")
test -z "$MOUNTED" && MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$RVOLUME[ \t]") test -z "$MOUNTED" && MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$RVOLUME[ \\t]")
MOUNTDEV=${MOUNTED%% on *} MOUNTDEV=${MOUNTED%% on *}
MOUNTED=${MOUNTED##* on } MOUNTED=${MOUNTED##* on }
MOUNTED=${MOUNTED% type *} # allow type in the mount name MOUNTED=${MOUNTED% type *} # allow type in the mount name