Just an example of choose a random line in text file, coded in Shell Script.
You can change the variable name that I called '$file' and replace 'list.txt' by the path and name of the file that you want use
file=list.txt
You can change the variable name that I called '$line', remembering to change the variable '$file' name, if you have changed it in previous step
line=$((1 + RANDOM % $(cat $file | wc -l)))
You can change the variable name that I called '$word', remembering to change the variables '$file' and '$line' names, if you have changed them in previous steps
word=$(cat $file | tr "\n" ":" | cut -d ":" -f "$line")
If you changed the variables names '$line' and '$word', change them below too
echo -e "The random line choosed is: $line\nThe word that is in that line is: $word\n"