imjustaguy imjustaguy - 1 year ago 122
Bash Question

Install script for private use in ubuntu

I created a script and i want to install it for my private use, i do this steps:

Set execute permission as follows:

$ chmod 755 demo

Run it & test it as follows:
$ ./demo Hello World

Copy script to your own bin directory (Install script for private use)
$ cp demo ~/bin

Check whether it is working or not
$ demo

$ demo Hello World

But i get this error:
No command 'demo' found

Answer Source

You will need to add the ~/bin path to $PATH environment variable so that the shell can find the demo executable.

$ PATH=$PATH:~/bin


You can specify the whole path to demo executable like this:

$ ~/bin/demo Hello World

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download