From 1eee4a49d7162f6d442749b047695c7124fdd2dc Mon Sep 17 00:00:00 2001 From: Thomas Negrault Date: Wed, 11 Oct 2023 18:41:05 +0200 Subject: [PATCH] Sort filenames alphabetically when using the restore command --- install/usr/local/bin/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/usr/local/bin/restore b/install/usr/local/bin/restore index e23dd2e..d08c61d 100755 --- a/install/usr/local/bin/restore +++ b/install/usr/local/bin/restore @@ -78,7 +78,7 @@ fi get_filename() { COLUMNS=12 prompt="Please select a file to restore:" - options=( $(find "${DB_DUMP_TARGET}" -type f -maxdepth 1 -not -name '*.md5' -not -name '*.sha1' -print0 | xargs -0) ) + options=( $(find "${DB_DUMP_TARGET}" -type f -maxdepth 1 -not -name '*.md5' -not -name '*.sha1' -print0 | sort -z | xargs -0) ) PS3="$prompt " select opt in "${options[@]}" "Custom" "Quit" ; do if (( REPLY == 2 + ${#options[@]} )) ; then