Skip to content

Instantly share code, notes, and snippets.

@mdtareque
Created August 19, 2020 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdtareque/2c43a129f13f7cfe090abc0e3475f348 to your computer and use it in GitHub Desktop.
Save mdtareque/2c43a129f13f7cfe090abc0e3475f348 to your computer and use it in GitHub Desktop.
mac verbal feedback
#https://askubuntu.com/questions/873719/how-to-set-a-variable-to-a-random-value-with-bash
#https://stackoverflow.com/questions/16553089/dynamic-variable-names-in-bash
#http://mywiki.wooledge.org/BashFAQ/006#Indirection
#declare "magic_variable_$1=v$(( $RANDOM % 1000 ))" ; var="magic_variable_$1"; echo "${!var}"
#read ${!var}
#echo $v396
function verbal_feedback ()
{
echo "enter any character and press enter, to stop verbal feedback.";
while [ 1 == 1 ]; do
declare "magic_variable=v$(( $RANDOM % 1000 ))" ; var="magic_variable"; dvar=${!var}; echo "${!var}"
read -t 2 $dvar
if [ ! -z "${!dvar}" ]; then
echo "$dvar is ${!dvar}";
break;
else
say -v Daniel "build completed";
sleep 1;
fi;
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment