Why was `.` chosen to represent the dot command?

The earliest mentioning of the dot command that I can find is in the manual for Stephen Bourne's sh shell in Unix Release 7 (it may be older, but not evidently present as one of the built-in commands in sh in Release 6).

. file  Read and execute commands from file and return.  The search path
        $PATH is used to find the directory containing file.

The dot, in quite general terms, seems to have been associated with "here" or "current". The . directory is the current directory, and the . address in the adb debugger from the same release of Unix had a . address which was the current address. Likewise, entering a . followed by newline in the ed editor will re-display the current line of the editing buffer (. addresses the current line). The dot also means the current node in certain structured query languages for XML, JSON, YAML, etc. (although these are later inventions).

It is therefore, I think, not too far fetched to speculate that the . command in the shell also means "here" or "current". In particular, "run this script in the current environment."

The dot is also quite quick and easy to type, and having a short command for doing a common task (whether it be in ed, adb or in the shell) may have been another reason why another longer name was not used.


Note that I don't have a functioning version of sh from Release 7 to test things in, and that I can't find the actual implementation of . in Bourne's shell from that release in the above-mentioned Git repository, so I can't say for sure that it actually did exactly what it does today. But it's likely that it did.


May it be because dot is the name of the symbol ..

1 : a small spot