I want to output an array with filenames and let the user select the file to process.
Currently I have the following:
patches=( $(ls $WORKING_DIR/PATCH_*) )
echo "Select available Patch to apply"
for i in "${!patches[@]}"; do
echo "$i"":" "${patches[$i]}"
done
echo "Line Number, followed by [ENTER]:"
read seleted_patch
echo "Patch to install:" "${patches[$selected_patch]}"
But _Patch to Install_ just outputs the first value of the patches array.
How can I get the value of the array the user enters on the commandline?