If script.sh is just something typical like
#!/bin/bash
echo "Hello World!"
Is there a preferred way to run the script? I think you first have to chmod it so it becomes executable?
If script.sh is just something typical like
Is there a preferred way to run the script? I think you first have to chmod it so it becomes executable? |
||||
|
For your specific script either way will work, except that The reason of the permissions requirement difference lies in how the program that interprets your script is loaded:
The shell forks itself and uses a system call (e.g. With your script, the program loader will execute
So the operating system will load I recommend using |
|||||||||||||||||||||
|
If you really want to know, which binary is executed if you do a So in your example it makes no difference. Yes, you have to |
|||||||||||||||||
|