aws icon indicating copy to clipboard operation
aws copied to clipboard

head command returns exit code 0 even on 404

Open ericjs opened this issue 9 years ago • 1 comments

If I run

aws head MY_BUCKET/some_object_that_doesnt_exist

I get

404 Not Found

(to stderr) however, if I then run

echo $?

I get

0

Just as I do when perform aws head on an object that does exist.

ericjs avatar Nov 17 '15 00:11 ericjs

Try adding --fail, which is passed on to curl.

On Mon, Nov 16, 2015 at 4:09 PM, Eric [email protected] wrote:

If I run '''bash aws head MY_BUCKET/some_object_that_doesnt_exist ''' I get '''bash 404 Not Found ''' (to stderr) however, if I then run '''bash echo $? ''' I get '''bash 0 ''' Just as I do when perform aws head on an object that does exist.

— Reply to this email directly or view it on GitHub https://github.com/timkay/aws/issues/100.

Tim Kay m: +1-650-248-0123 Skype: timkay

timkay avatar Nov 17 '15 22:11 timkay