Create scripts

To create a script you may write

#!/bin/bash

in a text file, made with gedit o similar. After this first line, put comands you need and save the file with the extension .sh.

To execute it you may give it permissions  to execute with the command:

chmod + example.sh

Then you can execute it. To execute it you may put the whole path, for example:

/home/ubuntu/example.sh

or copy it to the /bin folder.

If you want to run an script you’ve got in the same folder, you may write:

./example.sh

If you don’t put “./” you can’t execute the script.

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s