-
You can use absolute path or relative path to execute the script
-
Keep the script in the folder listed in $PATH
-
So what is $PATH?
- Computer has a list of folders where it searches for scripts. This list is called $PATH
- Make sure that the folder where the script is located is included in the $PATH list.
-
Order of the folders in the $PATH list matters.
- The computer looks for a script in each folder based on the order in which they appear in the list (
$PATH).
- So, if there are multiple folders with scripts of the same name, the computer will use the script from the first folder in the list that has it.