I trying to run script1.sh from script2.sh and answer script 1's prompts.
In script1.sh:
echo "Do you wish to save these settings?"
read response
if [ $response = "yes" ]
then
echo "Settings saved"
elif [ $response = "no" ]
then
echo "Settings not saved"
fi
echo "Would like to end"
read response2
if [ $response2 = "yes" ]
then
echo "Bye"
elif [ $response2 = "no" ]
then
echo "OK"
fi
In script2.sh:
sh "/home/username/Desktop/script1.sh"
I want it so that whenever i try to run script2.sh, it would automatically enter yes or no for both prompts for script1.sh.