From d2e9f6c0c1d2f6a88316198778515fe098d02dec Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Wed, 9 Sep 2015 15:28:01 -0700 Subject: [PATCH] Fix nuke script to remove from end of path Signed-off-by: Joe Ferguson --- contrib/nuke-graph-directory.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/nuke-graph-directory.sh b/contrib/nuke-graph-directory.sh index 8d12a9d646..99b527de15 100755 --- a/contrib/nuke-graph-directory.sh +++ b/contrib/nuke-graph-directory.sh @@ -52,7 +52,7 @@ done # now, let's go destroy individual btrfs subvolumes, if any exist if command -v btrfs > /dev/null 2>&1; then root="$(df "$dir" | awk 'NR>1 { print $NF }')" - root="${root#/}" # if root is "/", we want it to become "" + root="${root%/}" # if root is "/", we want it to become "" for subvol in $(btrfs subvolume list -o "$root/" 2>/dev/null | awk -F' path ' '{ print $2 }' | sort -r); do subvolDir="$root/$subvol" if dir_in_dir "$subvolDir" "$dir"; then