From 29db2b9b757b1bfb53e1b431086f5a2cac55f550 Mon Sep 17 00:00:00 2001 From: tactonbishop Date: Wed, 7 Dec 2022 07:00:04 +0000 Subject: [PATCH] Last Sync: 2022-12-07 07:00:04 --- Programming_Languages/Shell/Passing_arguments_to_scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Programming_Languages/Shell/Passing_arguments_to_scripts.md b/Programming_Languages/Shell/Passing_arguments_to_scripts.md index 161c34d..87221fd 100644 --- a/Programming_Languages/Shell/Passing_arguments_to_scripts.md +++ b/Programming_Languages/Shell/Passing_arguments_to_scripts.md @@ -11,7 +11,7 @@ tags: Whenever we issue a command in bash we are really running an executable program that is associated with the command. This is why when we create our own bash scripts we must run `chmod` to make them executables. When we issue a command like `./file.sh` we are running an executable program. -How come, however that when we use a program like `cd` or `npm` we don’t have to type `./cd.sh` or `./npm.sh` ? Remember from our discussion of the `PATH` environment variable that whenever we use inbuilt commands like `ls` and `cd` we are automatically sourcing them from the binary directory because we have these directories in our `PATH` . Hence the shell knows in advance what these commands mean. In the case of custom scripts, these aren’t typically added to the `PATH` so we have to source them in order to run them. +How come, however, that when we use a program like `cd` or `npm` we don’t have to type `./cd.sh` or `./npm.sh` ? Remember from our discussion of the `PATH` environment variable that whenever we use inbuilt commands like `ls` and `cd` we are automatically sourcing them from the binary directory because we have these directories in our `PATH` . Hence the shell knows in advance what these commands mean. In the case of custom scripts, these aren’t typically added to the `PATH` so we have to source them in order to run them. ## Passing arguments