GhettoVCB - clone.sh BASH Script
Jump to navigation
Jump to search
#!/bin/bash echo "Select the Baseline you would like to make your clone from." unset options i while IFS= read -r -d $'\0' f; do options[i++]="$f" done < <(find -maxdepth 1 -type d -name "CloneMe-*" -printf '%f\0' ) PS3="Enter a number (anything not in the list cancels): " select opt in ${options[@]} #Cancel do case $opt in CloneMe-*) echo "Baseline $opt selected" # processing ls $opt ;; *) echo "This is not in the list" echo "Cancelled!" break ;; esac done