Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

is there a higher reason why the original developers of the bourne shell decided to name the source command .?

(afaik the source command is bourne specific, correct me if i'm wrong)

note that bash has an alias for . called source, which is much more readable. sh does not have this alias, that means . is not a short form for source.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

As wikipedia states, the Bourne shell was written as a replacement to first shell ever, Thompson shell, and the latter was really stupid so it's unlikely that this design decision was derived from the predecessor. However, Bourne has used some of ALGOL 68's syntax rules, and this may be the cause... someone who knows ALGOL, please, correct me.

Such basic design decisions are rarely traceable to their roots just because they were obvious to original programmers, or taken from some common that times and now dead language, or just chosen randomly from a list of possibilities.

For me, the dot command associates with "the current something", i.e. like an alias to the interpreter in case of shellscript, and the short form means there are no process fork'd. Well, this is not a good explanation, but not worse than any other.

upd: You can also take a look at this article in ComputerWorld. While it does not answer your particular question, it may be interesting of itself.

share|improve this answer
add comment

They're not entirely synonymous. For example, while . is recognised by sh, it isn't built-in for csh. Likewise, while source is built-in for csh, it isn't a built-in command for sh.

I would imagine that . on sh did the same as source on csh, and thus both were implemented for compatibility reasons. I wasn't alive in the golden days of csh/sh though (if they ever were golden), so this is more speculation than anything ;)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.