From f154d48b5fc0b2fffaf1b1d7a8b2c28dbac7df65 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 11 Dec 2008 13:53:16 +0100 Subject: escape / in awk --- src/core/libs/lib-blockdevices-filesystems.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 6d8401c..89dc675 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -61,7 +61,8 @@ target_umountall() { infofy "Disabling all swapspace..." disks swapoff -a >/dev/null 2>&1 - for mountpoint in $(mount | awk "/\/$var_TARGET_DIR/ {print \$3}" | sort | tac ) + declare target=${var_TARGET_DIR//\//\\/} # escape all slashes otherwise awk complains + for mountpoint in $(mount | awk "/\/$target/ {print \$3}" | sort | tac ) do infofy "Unmounting mountpoint $mountpoint" disks umount $mountpoint >/dev/null 2>$LOG -- cgit v1.2.3-54-g00ecf