Home > Enterprise >  Executing Classic-Resource-Finder.sh on EC2 Amazon Linux 2
Executing Classic-Resource-Finder.sh on EC2 Amazon Linux 2

Time:11-03

How can I execute the Classic-Resource-Finder.sh script on Linux?

This script searches for EC2 classic resources on all regions that support EC2 classic.

I've already installed EC2 Linux 2 on AWS. AWS CLI is installed by default and I installed JQ as well.

I haven't found a way for a command that will allow me to execute the script from GitHub.

Help would be greatly appreciated.

CodePudding user response:

For running the remote script, without creating a local copy:

wget -O - https://raw.githubusercontent.com/aws-samples/ec2-classic-resource-finder/main/Classic-Resource-Finder.sh | bash

The above command triggers wget to download the file, with the output flag set to - to write the file's content (script) to standard output (STDOUT).

You can then simply pipe it to bash to run the script.


For running a local copy of the script:

chmod  x Classic-Resource-Finder.sh
bash Classic-Resource-Finder.sh

The 1st chmod x command makes the script executable for your current Linux user.

The 2nd command runs the script using the bash shell.

  • Related