Quote:
Originally Posted by Debian6to11
From where does bash understands <sshin> since the line is deleted now?
|
You obviously
made the script executable and put it into a directory on your
PATH.
When you issue the command
sshin 12, Bash sees the first word of the command is an executable in one of the directories on the PATH, calls the kernel via
execve(2) system call, and passes it the parsed command line.
The kernel, in turn, sees
the shebang #!/bin/bash in the first line, understands it is a script, and calls the script interpreter (
/bin/bash) with the script name as the first parameter preserving the parameters passed to it by the first instance of bash as the rest of the command line. As if you called it