You could let the python
interpreter read from stdin
using /dev/stdin
(similar to python -
) and pass the additional arguments alongside.
curl https://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py -s |\
python /dev/stdin --region eu-west-2
As Barmar points out using /dev/stdin
could be OS specific in which case using python -
would be more standard
curl https://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py -s |\
python - --region eu-west-2
As curl
outputs the file content to stdout, you can pipe it over to the standard input of the interpreter.
Or use process-substitution feature in bash
(<()
), which lets you treat the output of a command as if it were a file to read from
python <(curl https://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py -s) --region eu-west-2