Re-reading your question again I think I understand what you're asking.
Whatever you type in the command prompt is interpreted by an underlying shell (if you didn't change it, Bash).
There is a number of steps Bash goes through before actually running the command:
When the shell reads input, it proceeds through a sequence of operations. If the input indicates the beginning of a comment, the shell ignores the comment symbol (‘#’), and the rest of that line.
Otherwise, roughly speaking, the shell reads its input and divides the input into words and operators, employing the quoting rules to select which meanings to assign various words and characters.
The shell then parses these tokens into commands and other constructs, removes the special meaning of certain words or characters, expands others, redirects input and output as needed, executes the specified command, waits for the command’s exit status, and makes that exit status available for further inspection or processing.
Whatever is left to the right of the command delimited by any sequence of the separators contained in $IFS
, usually
, \t
and \n
after Bash has went through the steps outlined above is interpreted as an argument to the program: without being technical, this means that each token is made available to the program, which can make use of it the way it wants.
More specifically what happens under the hood is that each token is passed as an argument to the execve()
syscall which starts the program and becomes available to the program through argv
(a pointer to a pointer to a character often included in the declaration / definition of main()
), which the program can access in order to retrieve the arguments.
argv[]
) but it is up to it whether it does anything with them or not../myFile a
it stores (a pointer to) the stringa
in theargv
array (a kernel-managed list in the user processes' address space) for the program to pick up, parse, and interpret in any way it wants. The&
in./myFile &
is NOT a parameter passed to the program, its handled by the shell, which parses the command and starts./myFile
without waiting for it to finish (in the background),