forked from antiX-Linux/ddm-mx
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest-file
More file actions
executable file
·43 lines (30 loc) · 789 Bytes
/
test-file
File metadata and controls
executable file
·43 lines (30 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#test code
#build list, with Quit at end
declare -a list
readarray -t list < <(apt-cache madison nvidia-driver |awk '{print $3}' |grep -v deb |grep -v mx)
list[${#list[@]}]="Disable Nvidia Developer Repo (default)"
list[${#list[@]}]="Quit"
#size of array
echo "size of array is " "${#list[@]}"
for i in ${!list[@]}; do
echo "$i - ${list[$i]}"
done
#user enters a number of the driver they want
echo "choose a version"
read -e x
#validate string
case $x in
*[!0-9]*) echo "Invalid Choice, try again"
#choose_version
;;
*) if [ -z "$x" ]; then
echo "Keep Existing Selection"
else if [ $x -gt $((${#list[@]}-1)) ]; then
echo "Invalid Choice, try again"
else
VERSION=${list[$x]}
echo "version is " $VERSION
fi
fi ;;
esac