Skip to content

Instantly share code, notes, and snippets.

@dylan-sessler
Created March 3, 2022 19:54
Show Gist options
  • Save dylan-sessler/b361822205761175ca9a22e1a8c6bb99 to your computer and use it in GitHub Desktop.
Save dylan-sessler/b361822205761175ca9a22e1a8c6bb99 to your computer and use it in GitHub Desktop.
get-backup-filepath() {
PS3='Pick a file to revert from: '
select fname in $(head -n 10 <(ls $BACKUP_SAVE_LOCATION --sort=time))
do
if [[ $fname = "" ]]; then
echo $REPLY is not a valid option
else
echo "${BACKUP_SAVE_LOCATION}$fname"
break
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment