Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a bunch of commands seperated by \ns that I'd like to execute serially (from the command line) in a file called ec2-env-setup. I'd appreciate any help.

share|improve this question

3 Answers 3

up vote 11 down vote accepted

This is called a script.

Right click on the text file, select properties, select permission, mark the "Let this file be executed" text box. Now you can execute it just by double clicking on the file.

You can also do it from the console like this:

sh ec2-env-setup.

Or change the permissions and afterwards execute it:

chmod u+x ec2-env-setup.
./ec2-env-setup.
share|improve this answer

You need to make it excecutable:

chmod +x ec2-env-setup

And then run it (this will work if you are in the same directory as it, otherwise, use an absolute path).

./ec2-env-setup
share|improve this answer

Just for future reference, and to counter some of the command-line love going on here :-) you can also open the Properties of the file, select the Permissions pane and enable the Executable flags. If you then double-click the file, it'll let you run it as a script.

You might want to run it in the Terminal though if you'd like to see the output.

You can also create a Launcher. Right click on the Desktop and select Create Launcher to do that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.