show_solutions 336 Bytes
Newer Older
incardon's avatar
incardon committed
1 2 3 4 5 6 7 8 9 10 11
#! /bin/bash

function possible_solutions {
 sol=1
 echo "Possible solutions:"
 for com in "$@"
 do
   echo "$sol $com"
   sol=`expr $sol + 1`
 done
 echo "$sol exit the script"
incardon's avatar
incardon committed
12
 echo -e "\033[1;34;5mChoose the solution:\033[0m"
incardon's avatar
incardon committed
13 14 15 16 17 18 19
 read choose
 if [ x"$choose" = x"$sol" ]; then
  exit 1
 fi
 possible_solutions_ret=`expr $choose - 1`
}