问题
For e.g., when I say ". .bashrc" on my linux command prompt, is there a corresponding binary/script that gets executed in place of the first dot? If the dot itself is a command, where is its location?
回答1:
The . operator is shorthand for the source Bash builtin (as pointed out by John Kugelman below). Typing
help .
or
help source
at the Bash prompt will give you some information. For more on how source works, see http://www.ss64.com/bash/period.html.
回答2:
Additionally I want to point out that you don't "execute" anything with it (in terms of fork/exec), which is very important (and probably the only reason '.' exists).
来源:https://stackoverflow.com/questions/1107808/what-happens-when-i-execute-a-unix-shell-script-using-a-command