Trap, ERR, and echoing the error line
I’m trying to create some error reporting using a Trap to call a function on all errors:
I’m trying to create some error reporting using a Trap to call a function on all errors:
I am using curl to upload a file to a server via an HTTP post.
When I read this answer about $? another question comes to mind.
I am using Ubuntu 12.04.2. I am trying to use “trap” command to capture abnormal or error in my shell script but I am also trying to manually trigger “Error” exit.