timkay / aws

Easy command line access to Amazon EC2, S3, SQS, ELB, and SDB
http://timkay.com/aws/
424 stars 123 forks source link

head command returns exit code 0 even on 404 #100

Open ericjs opened 8 years ago

ericjs commented 8 years ago

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.

timkay commented 8 years ago

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

On Mon, Nov 16, 2015 at 4:09 PM, Eric notifications@github.com 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