Execute Bash Script From Anywhere

[Solved] Execute Bash Script From Anywhere | Perl - Code Explorer | yomemimo.com
Question : execute bash script from anywhere

Answered by : annoyed-addax-zrox2z8qt62a

you can modify the PATH environment variable in your .bashrc file and use the “source” command in order to refresh your current Bash environment.
$ sudo nano ~/.bashrc
export PATH="<path_to_script>:$PATH"
Exit the file and source your bashrc file for the changes to be applied.
$ source ~/.bashrc
$ echo $PATH
/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

Source : | Last Update : Thu, 17 Jun 21

Answers related to execute bash script from anywhere

Code Explorer Popular Question For Perl