I have a uninstaller that is a Unix executable but it prompts for confirmation.
Do you wish to continue (yes/no)?
So when I have a script call the executable it just hangs forever, how can I script it so the uninstaller runs correctly?
sudo "./Uninstall -Yes"
sudo "./Uninstall -Y"
No luck. any advice would be appreciated.
Hi @djrory ,
You could try:
#Respond to Yes or No prompt with a sleep time of 5 seconds (sleep 5; printf "Yes") | "/path/to/uninstaller"
Not sure if this is the same program, but is there a uninstall.sh, that'd probably be your best bet
sudo "/Library/Application Support/Checkpoint/Endpoint Security/uninstall.sh"
It's something I've never needed to really write myself, but I believe
expect might be a solution for what you need. It used to be needed when accepting the Xcode license automagically with a script, since
xcodebuild used to require someone enter "accept" into the Terminal window.
You'd want something like this as a script body:
/usr/bin/expect -f set timeout -1 spawn ./path/to/your/interactive/script.sh expect "Do you wish to continue (yes/no)" send "yes " expect eof