I am trying to write a BASH function that will do x if program a or b finish.
example:
echomessage()
{
echo "here's your message"
if [[sleep 3 || read -p "$*"]]
then
clear
fi
}
In this scenario:
a = 'sleep 3
' which is supposed to run x after 3 seconds
b = 'read -p "$*"
' which is supposed to run x upon providing any keyboard input.
x = 'clear
' which clears the echo output if either the program times out with sleep or the user presses a key on the keyboard.