2

I know to run a remote script, we can use

curl -s <remote-script-url> | python or wget -O - <remote-script-url> | bash

But, instead of specifying the interpreter explicitly, can we run the script using shebang.

My use case is, the scripts will be from trusted sources - may be python or bash and I run it from EC2 User data. If the above is not possible, is it a way to achieve the same using cloud-config (script will be in s3)

Thanks in advance

Abdul Aziz Barkat
  • 19,475
  • 3
  • 20
  • 33
Shan
  • 2,141
  • 2
  • 17
  • 32
  • Download it to a file, mark the file as executable and run it. I'm sure you can do it as a 1 liner if you try hard enough... – John3136 Jul 30 '15 at 07:11
  • Thanks John, that is what I'm doing right now.. I'm taking care of deleting the script after executing it. I don't want users to execute again after the instance is up. – Shan Jul 30 '15 at 07:32

0 Answers0