Also, I think it makes sense to split the download and shell execution into separate commands.  That way, you can give better error messages if one or the other fails.