#!/bin/bash

VMHOME="$HOME/Documents/Virtual Machines.localized"

if [[ ! -d "$VMHOME" ]]; then
    VMHOME="$HOME/Virtual Machines.localized"
    if [[ ! -d "$VMHOME" ]]; then
        echo "This script assumes that $VMHOME exists."
        exit 1
    fi
fi

for vm in [A-KN-Z]*; do
    echo "Installing $vm"
    if [[ -d "$VMHOME/$vm" ]]; then
        echo "$VMHOME/$vm already exists! Will not overwrite."
    else
        mv "$vm" "$VMHOME/"
        open "$VMHOME/$vm"/*.vmx || true
    fi
done


#!/bin/bash

VMHOME="$HOME/Documents/Virtual Machines.localized"

if [[ ! -d "$VMHOME" ]]; then
    echo "This script assumes that $VMHOME exists."
    exit 1
fi

for vm in [A-KN-Z]*; do
    echo "Installing $vm"
    if [[ -d "$VMHOME/$vm" ]]; then
        echo "$VMHOME/$vm already exists! Will not overwrite."
    else
        mv "$vm" "$VMHOME/"
        open "$VMHOME/$vm"/*.vmx || true
    fi
done


--- 
+++ 
@@ -3,8 +3,11 @@
 VMHOME="$HOME/Documents/Virtual Machines.localized"
 
 if [[ ! -d "$VMHOME" ]]; then
-    echo "This script assumes that $VMHOME exists."
-    exit 1
+    VMHOME="$HOME/Virtual Machines.localized"
+    if [[ ! -d "$VMHOME" ]]; then
+        echo "This script assumes that $VMHOME exists."
+        exit 1
+    fi
 fi
 
 for vm in [A-KN-Z]*; do
Make sure to check current default location.
