From 5fb1bbfe73d63e475c01e39b74919977e25b666c Mon Sep 17 00:00:00 2001 From: Lawrence Steele Date: Mon, 5 Nov 2018 03:49:49 -0500 Subject: [PATCH] Removed brackets They weren't needed and they created problems with the awk commands I would rather not have to deal with. --- .scripts/dmenumount | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.scripts/dmenumount b/.scripts/dmenumount index 1fc03e81..fe8865ce 100755 --- a/.scripts/dmenumount +++ b/.scripts/dmenumount @@ -16,7 +16,7 @@ getmount() { \ } mountusb() { \ - chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $2}')" + chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk -F'[ ]' '{print $2}')" sudo -A mount "$chosen" && exit 0 getmount "/mnt /media /mount /home -maxdepth 5 -type d" sudo -A mount "$chosen" "$mp" && pgrep -x dunst && notify-send "$chosen mounted to $mp." @@ -37,7 +37,7 @@ asktype() { \ } anddrives=$(simple-mtpfs -l 2>/dev/null) -usbdrives="$(lsblk -rpo "name,type,size,mountpoint,label" | awk -F'[ ]' '$2=="part" && $4=="" {str=($5=="") ? sprintf("%s (%s)\n",$1,$3) : sprintf("[%s] %s (%s)\n",$5,$1,$3); printf("%s",str)}')" +usbdrives="$(lsblk -rpo "name,type,size,mountpoint,label" | awk -F'[ ]' '$2=="part" && $4=="" printf("%s %s (%s)\n",$5,$1,$3)}')" if [ -z "$usbdrives" ]; then [ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit echo "Android device(s) detected."