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. Now, .
file
does exactly the same.
Beyond that .
alone means "the current working directory" as in ./xyz
("xyz
in this directory") or a/b/./c/./d
(which is identical to a/b/c/d
).
Beyond that .
in a filename has a meaning only by convention as in .foobar
which indicates a "hidden" file (not really...) or as in foobar.pdf
, which indicates a file format by the suffix (here .pdf
).
These different meanings cannot be interchanged.
. script
and./script
are the same thing? They most certainly are not. Also,.
is not an alias tosource
. It's the other way around..
is the standard andsource
is an alias of.
. – terdon Sep 14 '16 at 09:27.
command, but I meansource
is just such a better command, when you seesource somefile
in a script you immediately know what that statement does, but. somefile
not only is not obvious what it does, you can easily miss the.
character altogether – the_velour_fog Sep 14 '16 at 09:47bash: .: .: is a directory
on. .
is ok needs to be explained. – countermode Sep 14 '16 at 10:25. ./.a.a .
to be honest. :-D A quiz of sorts, if you will. :-) Linked question is awesome, many thanks. What gave me that idea: the fact that I had seen no difference in executing files this way and the fact I read somewhere.
is an alias forsource
. :-) – LAFK says Reinstate Monica Sep 14 '16 at 16:14