Skip to content
September 13, 2008 / technocrawl

Compiling a shell script.

To create a new file in unix based environments we can use text editors like vi, vim, emacs, gedit,etc..

If you use vi editor, for compiling and executing a shell script then follow the steps given below,

1. Just open terminal and type as “vi <file_name>.sh” and enter (.sh is extension for shell script)

2. Write required script and save the script by using shift+;(semi-colon) and w.

3. To quit the editor you need to press shift+;(semi-colon) and q. (Note:Both q and w are lower-case)

4. Its no need for you to be logged in as a Root to execute the Shell scripts,  Else if you wanna to run

the script with Root then you may use ‘su’ command.

5. To execute type as “sh <file_name>.sh” and enter.

You’re done.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

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

%d bloggers like this: