Sample Header Ad - 728x90

How can I set a bash script to wait for user input (not exit) on error?

0 votes
1 answer
128 views
I know that set -e tells bash to exit the script on error. The problem is that I have to address the error, then delete all previous steps from the script while maintaining any variables before executing it again to continue. Is there a way to have the script simply wait for user input read -p "Continue? " on error? If not, is there anything similar? I want the script to stop on error, then continue again when I'm ready.
Asked by user2013318 (11 rep)
Mar 6, 2025, 01:30 PM
Last activity: Mar 6, 2025, 03:59 PM