How do I make a new command to run a script, for example if I type runme
(from any dir) it will run /run/me/script.sh
?
Seems simple but I can find anywhere that explains how to do this :/
How do I make a new command to run a script, for example if I type runme
(from any dir) it will run /run/me/script.sh
?
Seems simple but I can find anywhere that explains how to do this :/
simply add /run/me to your PATH, any script put there could be simply run from any directory
how to PATH from troubleshooters.com
To add directory /data/myscripts to the beginning of the $PATH environment variable, use the following:
PATH=/data/myscripts:$PATH
To add that directory to the end of the path, use the following command:
PATH=$PATH:/data/myscripts
finally
export PATH
to have it everywhere, all the times, for your user only, add these in place the lines in that user's .bash_profile file
all users except root: add to /etc/profile
for root: only possible by root's .bash_profile
my idea for the sake of laziness (not your case of running 'every' script though): add a symbolic link from a single script there to your /home/usr/loca/bin