When reading Bash Reference Manual in shell operation, it says:
- Reads its input from a file (see Shell Scripts), from a string supplied as an argument to the -c invocation option (see Invoking Bash), or from the user’s terminal.
Here are my questions:
- what is the difference of the 3 ways of reading input?
- can a script have arguments? like
$ ./script arg1 arg2 ...
And when I type some command one the terminal like:
$ command1 arg1 arg2 ...
How does Bash know
command1 is a executable (no further processing, just execute it) not a script (to read the content of the script)?