Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 5
    "while maintaining any variables before executing it again to continue"? I think you will have to show your script or at least explain what it is doing, in detail. I can't think of very many types of errors that can be fixed while the script is running. Also, using set -e as a way of doing "error handling" is almost always misguided. Explicit tests on the relevant operations makes it easier to catch and handle errors in an intelligent way. Commented Mar 6 at 13:37
  • If you want to do something for error handling, you could check the exit code and do what's necessary like if ! do_something ; then handle_error ; exit 1 ; fi or use trap handle_error ERR like in unix.stackexchange.com/a/39660/330217 Commented Mar 6 at 13:44
  • @Bodo Thank you. This will work for my purpose. Commented Mar 14 at 0:41