When using bash shell, I sometimes keep environment variables in a text file which I copy/paste the content of, eg exports.txt:
export FOO=bar
export FIZZ=buzz
Someone showed me instead of copy/paste, I could type in the terminal
. exports.txt
which would have the same effect as copy/paste.
What is the mechanism by which this 'dot space filename' command works? It's hard to think of search terms for it.
I want to understand what is happening and the more general details of what this one-liner is doing.
help .
This is so short the Stack Exchange engine thinks it's too short to be a comment.'. ' args
, with single or double quotes. Otherwise the unquoted space is eaten up by bash when it parses the line into tokens (see "word splitting" in the bash manual)..
issource
, which literally means "source commands from this file," at least to me.