#!/bin/sh
echo "Do you know how to use: '"$(compgen -c | gshuf -n 1)"'?"
read -p "Yes or No?(y/n)" -n 1 -r
echo
if [[ $REPLY =~ [[Yy]$ ]]
then
echo "Cool! Post your knowledge to your blog or favorite site."
else
echo "OK, study it and then post about that."
fi
$ ./command-questions.sh
Do you know how to use: 'ldapsearch'?
Yes or No?(y/n)n
OK, study it and then post about that.
$ ./command-questions.sh
Do you know how to use: 'sort'?
Yes or No?(y/n)y
Cool! Post your knowledge to your blog or favorite site.