Making your Shell Program work as a command

Many  a times there is a need to make a Shell Program , work as a command for your system.

For this the easiest way is to :

– add it to the /usr/bin directory. (You  need to be superuser to do this)

e.g. If we write a Shell Script as “a.sh”

#!/bin/bash

echo Hello

You can just type in :

sudo cp a.sh /usr/bin

Advertisements

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

%d bloggers like this: