I hope that I can trap curl errors, and have my shell script error out and quit if curl has any sort of problem.
For example, I have the following command in my shell script:
curl --trace -n -v --ftp-ssl ftp://xxx.xxx.xxx.xxx:2122 --user user:password -o /tmp/file.txt
Works great, except for sometimes when we have a network problem or something, and I get:
curl: (56) FTP response reading failed
So I get a good error message, but I want my whole script to send an error signal if this occurs.
In other words, I'd like the script to send a signal similar to what would occur with an 'exit 1' to the OS. I can do this with an error trapping function, but does curl have a flag or something for signaling so I don't have to write a function?
OR perhaps am I not understanding what I need to detect an error and signal?
Thank you for your time and understanding.