What is Linux source command?
source is a shell built-in command which is used to read and execute the content of a file(generally set of commands), passed as an argument in the current shell script. If any arguments are supplied, they become the positional parameters when filename is executed. Otherwise, the positional parameters remain unchanged.
What does the dot mean in terminal?
The dot command ( . ), aka full stop or period, is a command used to evaluate commands in the current execution context.
What is meant by sourcing a script?
Sourcing a script will run the commands in the current shell process. Executing a script will run the commands in a new shell process. Use source if you want the script to change the environment in your currently running shell. use execute otherwise.
Why is Bash OK while source source is not?
Bonus, why is . . OK while source source is not? The second . represents the current directory, you can’t replace that with source (especially not ./ with source as you’ve done). would be OK if you had a file called source in the current directory, containing something meaningful for your current shell. I can’t see how . . would be OK…
What’s the difference between executing a file in Bash?
See What is the difference between sourcing (‘.’ or ‘source’) and executing a file in bash? for details. source is a shell keyword that is supposed to be used like this: source file where file contains valid shell commands. These shell commands will be executed in the current shell as if typed from the command line.
Is the bash alias for source the same as the source?
. ./.a.a and ./.a.a is the same. However trying source source .a.a gives an error. IMO, . being Bash alias for source shouldn’t behave differently, so what am I missing? Bonus, why is . . OK while source source is not? The second . represents the current directory, you can’t replace that with source (especially not ./ with source as you’ve done).