Skip to content

Commit

Permalink
fix issue with whitespaces in volume names
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-korneck committed Feb 13, 2021
1 parent 3900b74 commit 2835706
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions macbac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ disable() {
}

getVolumes() {
ls -d /Volumes/*
ls -1d /Volumes/*
}

getSnapshots() {
Expand All @@ -222,9 +222,13 @@ listStatus() {
}

listSnapshots() {
volumes=$(getVolumes)
declare -a volumes

for volume in $(getVolumes); do
while read -r line; do
volumes+=("$line")
done <<< $(getVolumes)

for volume in "${volumes[@]}"; do
# show current volume
echo -e "${BOLD}${volume}${NC}"

Expand Down

0 comments on commit 2835706

Please sign in to comment.