Wrong status value from bash script

bash, curl, http

Solution

This is not possible to exit with HTTP response code from bash script, because bash script can only exit with values `0-255`. Value `404` overflowed and turned into `148`:

404 mod 256=148

Problem

My bash script runs `curl` command internally. I want to return the HTTP response code as the status of my script. I'm doing this like here: ``` statusCode=404 if [ $statusCode -ne 200 ] then echo $statusCode exit $statusCode fi exit 0 ``` Status code is echoed properly (`404`), but status value (`$?`) is `148`. What am I doing wrong?

Original source