Skip to main content
Specified the $0 default content
Source Link
Jaroslav Kucera
  • 11k
  • 5
  • 17
  • 30

No, these are parameters of the script. For example if you call your script like:

mynicescript.sh one two three 

then inside the script, there will be these parameters available as

$1 = one $2 = two $3 = three 

and the $0 is the name of the script itself.

So when you're outside the script, these variables aren't available (except $0, which displays /bin/bash - the shell itself).

No, these are parameters of the script. For example if you call your script like:

mynicescript.sh one two three 

then inside the script, there will be these parameters available as

$1 = one $2 = two $3 = three 

and the $0 is the name of the script itself.

So when you're outside the script, these variables aren't available.

No, these are parameters of the script. For example if you call your script like:

mynicescript.sh one two three 

then inside the script, there will be these parameters available as

$1 = one $2 = two $3 = three 

and the $0 is the name of the script itself.

So when you're outside the script, these variables aren't available (except $0, which displays /bin/bash - the shell itself).

Source Link
Jaroslav Kucera
  • 11k
  • 5
  • 17
  • 30

No, these are parameters of the script. For example if you call your script like:

mynicescript.sh one two three 

then inside the script, there will be these parameters available as

$1 = one $2 = two $3 = three 

and the $0 is the name of the script itself.

So when you're outside the script, these variables aren't available.