execute script from any location.

Hello,

Can someone tell me the method to execute the script from any location on linux server whereas It resides on a particular location

e.g.: Suppose script resides at this location

/efare1/dist/src
monitor.sh

But I want If user know the name of the script he should not remember the path of that script he can run it from any location.Please let me know if this possible.

Thanks

There is a shell environment variable $PATH that lists directories to search for commands. It is a colon separated list, just add /efare1/dist/src to the end of this in the users .profile (or .bash_profile) and export it:

PATH=$PATH:/efare1/dist/src
export PATH

Add an entry in profile file based on your type of shell. For e.g. ( bash - .profile or .bash_profile, csh - .cshrc etc.)