Why was the dot (.) used as an alias for source & why don't other commands have shortcuts too? [closed]
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
3
down vote
favorite
EDIT : actually, it is not an alias (see answers)
As you all know, in a shell, the dot-command (.
) is an alias to the source command.
But I wonder if there's a reason behind such a weird alias? Apparently, I don't use it so often that I would need such a short alias.
So, why a dot? And why for source
and not a more commonly used command such as cd
or ls
? Why even an alias? Is there a good reason behind that? Or is there a historical reason?
NOTE: I originally posted this question on Server Fault but I was suggested to post it here instead.
bash shell historical-unix
closed as primarily opinion-based by slm⦠Jul 29 at 3:35
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
 |Â
show 2 more comments
up vote
3
down vote
favorite
EDIT : actually, it is not an alias (see answers)
As you all know, in a shell, the dot-command (.
) is an alias to the source command.
But I wonder if there's a reason behind such a weird alias? Apparently, I don't use it so often that I would need such a short alias.
So, why a dot? And why for source
and not a more commonly used command such as cd
or ls
? Why even an alias? Is there a good reason behind that? Or is there a historical reason?
NOTE: I originally posted this question on Server Fault but I was suggested to post it here instead.
bash shell historical-unix
closed as primarily opinion-based by slm⦠Jul 29 at 3:35
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
4
You actually have it backwards
â Jesse_b
Jul 28 at 19:51
2
.
is not an alias in the first place; nor is it a secondary name. This question takes a falsehood as its premise and, as demonstrated by the answers so far, is unanswerable except to say that the question is wrong, as such loaded questions are.
â JdeBP
Jul 28 at 22:11
@JdeBP Actually, I triedalias source
andalias .
in order to know which one was the alias of the other but got no response from the command line. Now I understand why. Hence, I supposed that.
was the alias because it was the shortest. I edited the question to make it clearer that the question is actually wrong. I did not change the title because it would change the meaning of the answers.
â Arnaud Denoyelle
Jul 28 at 22:16
The next question can be found in the list that I collected two years ago at superuser.com/questions/1136409/#comment1631506_1136409 . (-:
â JdeBP
Jul 28 at 22:29
Possible duplicate - unix.stackexchange.com/questions/58514/â¦
â slmâ¦
Jul 29 at 2:54
 |Â
show 2 more comments
up vote
3
down vote
favorite
up vote
3
down vote
favorite
EDIT : actually, it is not an alias (see answers)
As you all know, in a shell, the dot-command (.
) is an alias to the source command.
But I wonder if there's a reason behind such a weird alias? Apparently, I don't use it so often that I would need such a short alias.
So, why a dot? And why for source
and not a more commonly used command such as cd
or ls
? Why even an alias? Is there a good reason behind that? Or is there a historical reason?
NOTE: I originally posted this question on Server Fault but I was suggested to post it here instead.
bash shell historical-unix
EDIT : actually, it is not an alias (see answers)
As you all know, in a shell, the dot-command (.
) is an alias to the source command.
But I wonder if there's a reason behind such a weird alias? Apparently, I don't use it so often that I would need such a short alias.
So, why a dot? And why for source
and not a more commonly used command such as cd
or ls
? Why even an alias? Is there a good reason behind that? Or is there a historical reason?
NOTE: I originally posted this question on Server Fault but I was suggested to post it here instead.
bash shell historical-unix
edited Jul 29 at 3:32
slmâ¦
232k65479649
232k65479649
asked Jul 28 at 19:50
Arnaud Denoyelle
1244
1244
closed as primarily opinion-based by slm⦠Jul 29 at 3:35
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as primarily opinion-based by slm⦠Jul 29 at 3:35
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
4
You actually have it backwards
â Jesse_b
Jul 28 at 19:51
2
.
is not an alias in the first place; nor is it a secondary name. This question takes a falsehood as its premise and, as demonstrated by the answers so far, is unanswerable except to say that the question is wrong, as such loaded questions are.
â JdeBP
Jul 28 at 22:11
@JdeBP Actually, I triedalias source
andalias .
in order to know which one was the alias of the other but got no response from the command line. Now I understand why. Hence, I supposed that.
was the alias because it was the shortest. I edited the question to make it clearer that the question is actually wrong. I did not change the title because it would change the meaning of the answers.
â Arnaud Denoyelle
Jul 28 at 22:16
The next question can be found in the list that I collected two years ago at superuser.com/questions/1136409/#comment1631506_1136409 . (-:
â JdeBP
Jul 28 at 22:29
Possible duplicate - unix.stackexchange.com/questions/58514/â¦
â slmâ¦
Jul 29 at 2:54
 |Â
show 2 more comments
4
You actually have it backwards
â Jesse_b
Jul 28 at 19:51
2
.
is not an alias in the first place; nor is it a secondary name. This question takes a falsehood as its premise and, as demonstrated by the answers so far, is unanswerable except to say that the question is wrong, as such loaded questions are.
â JdeBP
Jul 28 at 22:11
@JdeBP Actually, I triedalias source
andalias .
in order to know which one was the alias of the other but got no response from the command line. Now I understand why. Hence, I supposed that.
was the alias because it was the shortest. I edited the question to make it clearer that the question is actually wrong. I did not change the title because it would change the meaning of the answers.
â Arnaud Denoyelle
Jul 28 at 22:16
The next question can be found in the list that I collected two years ago at superuser.com/questions/1136409/#comment1631506_1136409 . (-:
â JdeBP
Jul 28 at 22:29
Possible duplicate - unix.stackexchange.com/questions/58514/â¦
â slmâ¦
Jul 29 at 2:54
4
4
You actually have it backwards
â Jesse_b
Jul 28 at 19:51
You actually have it backwards
â Jesse_b
Jul 28 at 19:51
2
2
.
is not an alias in the first place; nor is it a secondary name. This question takes a falsehood as its premise and, as demonstrated by the answers so far, is unanswerable except to say that the question is wrong, as such loaded questions are.â JdeBP
Jul 28 at 22:11
.
is not an alias in the first place; nor is it a secondary name. This question takes a falsehood as its premise and, as demonstrated by the answers so far, is unanswerable except to say that the question is wrong, as such loaded questions are.â JdeBP
Jul 28 at 22:11
@JdeBP Actually, I tried
alias source
and alias .
in order to know which one was the alias of the other but got no response from the command line. Now I understand why. Hence, I supposed that .
was the alias because it was the shortest. I edited the question to make it clearer that the question is actually wrong. I did not change the title because it would change the meaning of the answers.â Arnaud Denoyelle
Jul 28 at 22:16
@JdeBP Actually, I tried
alias source
and alias .
in order to know which one was the alias of the other but got no response from the command line. Now I understand why. Hence, I supposed that .
was the alias because it was the shortest. I edited the question to make it clearer that the question is actually wrong. I did not change the title because it would change the meaning of the answers.â Arnaud Denoyelle
Jul 28 at 22:16
The next question can be found in the list that I collected two years ago at superuser.com/questions/1136409/#comment1631506_1136409 . (-:
â JdeBP
Jul 28 at 22:29
The next question can be found in the list that I collected two years ago at superuser.com/questions/1136409/#comment1631506_1136409 . (-:
â JdeBP
Jul 28 at 22:29
Possible duplicate - unix.stackexchange.com/questions/58514/â¦
â slmâ¦
Jul 29 at 2:54
Possible duplicate - unix.stackexchange.com/questions/58514/â¦
â slmâ¦
Jul 29 at 2:54
 |Â
show 2 more comments
3 Answers
3
active
oldest
votes
up vote
10
down vote
accepted
.
is the POSIX standard.
source
is a bash builtin synonym for .
and is not as portable as .
Also note in the Bash reference manual .
is listed under 4.1 Bourne Shell Builtins and source
is listed under 4.2 Bash Builtin Commands as:
A synonym for . (see Bourne Shell Builtins).
It's possible that bash named it source
because that's what it was called in C shell (where the command apparently originated).
1
Your answer is not correct, sorry. Dot is from the Bourne Shell and source is from csh, see my answer.
â schily
Jul 28 at 21:45
1
@schily: Where did I say something contrary?
â Jesse_b
Jul 28 at 21:46
1
@Jesse_b: he's saying that POSIX was introduced in the eighties, but dot predates that by a decade or so. So if you want to know why dot and not something else, POSIX doesn't explain that. Right, everybody? Actually I don't think schily's answer answers the question either, as written: it doesn't say anything about why "." was chosen rather than some other name.
â Croad Langshan
Jul 28 at 21:57
1
Really seems the primary question here isSo, why a dot?
, and your other question is a duplicate. I'm genuinely not sure which if any of the subsidiary questions (which I think you would have better chosen to comment on or ignore) you're answering here...
â Croad Langshan
Jul 28 at 22:04
1
@JdeBP yes I saw the other question, I just think you both misinterpreted this one.
â Croad Langshan
Jul 28 at 22:05
 |Â
show 8 more comments
up vote
1
down vote
The dot command was introduced by the Bourne Shell most likely in 1976.
The source command was introduced by the csh in 1977 or 1978.
So there is not an alias relation but two different names for an "invention" at the same time.
BTW: I can tell you why cd
is named this way. The command previously had been called chdir
, but this was too long (slow to type) for the upcoming 110 Baud modems in 1974...
3
source
could be even older, since it was a command in the Michigan terminal system.
â xenoid
Jul 29 at 0:21
source
is an obvious name, but I doubt that Bill Joy did know the MTS.
â schily
Jul 29 at 7:44
add a comment |Â
up vote
0
down vote
As far as Bash is concerned the .
and source
are not aliases for one or the other, it's a simple fact that they're both builtins which call the same underlying function, source_builtin
.
Take a look at the source.def
file from the Bash source code:
$PRODUCES source.c
$BUILTIN source
$FUNCTION source_builtin
$SHORT_DOC source filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
$BUILTIN .
$DOCNAME dot
$FUNCTION source_builtin
$SHORT_DOC . filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
References
- path: root/builtins/source.def
- What is the difference between âÂÂsourceâ and âÂÂ.âÂÂ?
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
10
down vote
accepted
.
is the POSIX standard.
source
is a bash builtin synonym for .
and is not as portable as .
Also note in the Bash reference manual .
is listed under 4.1 Bourne Shell Builtins and source
is listed under 4.2 Bash Builtin Commands as:
A synonym for . (see Bourne Shell Builtins).
It's possible that bash named it source
because that's what it was called in C shell (where the command apparently originated).
1
Your answer is not correct, sorry. Dot is from the Bourne Shell and source is from csh, see my answer.
â schily
Jul 28 at 21:45
1
@schily: Where did I say something contrary?
â Jesse_b
Jul 28 at 21:46
1
@Jesse_b: he's saying that POSIX was introduced in the eighties, but dot predates that by a decade or so. So if you want to know why dot and not something else, POSIX doesn't explain that. Right, everybody? Actually I don't think schily's answer answers the question either, as written: it doesn't say anything about why "." was chosen rather than some other name.
â Croad Langshan
Jul 28 at 21:57
1
Really seems the primary question here isSo, why a dot?
, and your other question is a duplicate. I'm genuinely not sure which if any of the subsidiary questions (which I think you would have better chosen to comment on or ignore) you're answering here...
â Croad Langshan
Jul 28 at 22:04
1
@JdeBP yes I saw the other question, I just think you both misinterpreted this one.
â Croad Langshan
Jul 28 at 22:05
 |Â
show 8 more comments
up vote
10
down vote
accepted
.
is the POSIX standard.
source
is a bash builtin synonym for .
and is not as portable as .
Also note in the Bash reference manual .
is listed under 4.1 Bourne Shell Builtins and source
is listed under 4.2 Bash Builtin Commands as:
A synonym for . (see Bourne Shell Builtins).
It's possible that bash named it source
because that's what it was called in C shell (where the command apparently originated).
1
Your answer is not correct, sorry. Dot is from the Bourne Shell and source is from csh, see my answer.
â schily
Jul 28 at 21:45
1
@schily: Where did I say something contrary?
â Jesse_b
Jul 28 at 21:46
1
@Jesse_b: he's saying that POSIX was introduced in the eighties, but dot predates that by a decade or so. So if you want to know why dot and not something else, POSIX doesn't explain that. Right, everybody? Actually I don't think schily's answer answers the question either, as written: it doesn't say anything about why "." was chosen rather than some other name.
â Croad Langshan
Jul 28 at 21:57
1
Really seems the primary question here isSo, why a dot?
, and your other question is a duplicate. I'm genuinely not sure which if any of the subsidiary questions (which I think you would have better chosen to comment on or ignore) you're answering here...
â Croad Langshan
Jul 28 at 22:04
1
@JdeBP yes I saw the other question, I just think you both misinterpreted this one.
â Croad Langshan
Jul 28 at 22:05
 |Â
show 8 more comments
up vote
10
down vote
accepted
up vote
10
down vote
accepted
.
is the POSIX standard.
source
is a bash builtin synonym for .
and is not as portable as .
Also note in the Bash reference manual .
is listed under 4.1 Bourne Shell Builtins and source
is listed under 4.2 Bash Builtin Commands as:
A synonym for . (see Bourne Shell Builtins).
It's possible that bash named it source
because that's what it was called in C shell (where the command apparently originated).
.
is the POSIX standard.
source
is a bash builtin synonym for .
and is not as portable as .
Also note in the Bash reference manual .
is listed under 4.1 Bourne Shell Builtins and source
is listed under 4.2 Bash Builtin Commands as:
A synonym for . (see Bourne Shell Builtins).
It's possible that bash named it source
because that's what it was called in C shell (where the command apparently originated).
edited Jul 28 at 21:05
answered Jul 28 at 19:59
Jesse_b
10.1k12658
10.1k12658
1
Your answer is not correct, sorry. Dot is from the Bourne Shell and source is from csh, see my answer.
â schily
Jul 28 at 21:45
1
@schily: Where did I say something contrary?
â Jesse_b
Jul 28 at 21:46
1
@Jesse_b: he's saying that POSIX was introduced in the eighties, but dot predates that by a decade or so. So if you want to know why dot and not something else, POSIX doesn't explain that. Right, everybody? Actually I don't think schily's answer answers the question either, as written: it doesn't say anything about why "." was chosen rather than some other name.
â Croad Langshan
Jul 28 at 21:57
1
Really seems the primary question here isSo, why a dot?
, and your other question is a duplicate. I'm genuinely not sure which if any of the subsidiary questions (which I think you would have better chosen to comment on or ignore) you're answering here...
â Croad Langshan
Jul 28 at 22:04
1
@JdeBP yes I saw the other question, I just think you both misinterpreted this one.
â Croad Langshan
Jul 28 at 22:05
 |Â
show 8 more comments
1
Your answer is not correct, sorry. Dot is from the Bourne Shell and source is from csh, see my answer.
â schily
Jul 28 at 21:45
1
@schily: Where did I say something contrary?
â Jesse_b
Jul 28 at 21:46
1
@Jesse_b: he's saying that POSIX was introduced in the eighties, but dot predates that by a decade or so. So if you want to know why dot and not something else, POSIX doesn't explain that. Right, everybody? Actually I don't think schily's answer answers the question either, as written: it doesn't say anything about why "." was chosen rather than some other name.
â Croad Langshan
Jul 28 at 21:57
1
Really seems the primary question here isSo, why a dot?
, and your other question is a duplicate. I'm genuinely not sure which if any of the subsidiary questions (which I think you would have better chosen to comment on or ignore) you're answering here...
â Croad Langshan
Jul 28 at 22:04
1
@JdeBP yes I saw the other question, I just think you both misinterpreted this one.
â Croad Langshan
Jul 28 at 22:05
1
1
Your answer is not correct, sorry. Dot is from the Bourne Shell and source is from csh, see my answer.
â schily
Jul 28 at 21:45
Your answer is not correct, sorry. Dot is from the Bourne Shell and source is from csh, see my answer.
â schily
Jul 28 at 21:45
1
1
@schily: Where did I say something contrary?
â Jesse_b
Jul 28 at 21:46
@schily: Where did I say something contrary?
â Jesse_b
Jul 28 at 21:46
1
1
@Jesse_b: he's saying that POSIX was introduced in the eighties, but dot predates that by a decade or so. So if you want to know why dot and not something else, POSIX doesn't explain that. Right, everybody? Actually I don't think schily's answer answers the question either, as written: it doesn't say anything about why "." was chosen rather than some other name.
â Croad Langshan
Jul 28 at 21:57
@Jesse_b: he's saying that POSIX was introduced in the eighties, but dot predates that by a decade or so. So if you want to know why dot and not something else, POSIX doesn't explain that. Right, everybody? Actually I don't think schily's answer answers the question either, as written: it doesn't say anything about why "." was chosen rather than some other name.
â Croad Langshan
Jul 28 at 21:57
1
1
Really seems the primary question here is
So, why a dot?
, and your other question is a duplicate. I'm genuinely not sure which if any of the subsidiary questions (which I think you would have better chosen to comment on or ignore) you're answering here...â Croad Langshan
Jul 28 at 22:04
Really seems the primary question here is
So, why a dot?
, and your other question is a duplicate. I'm genuinely not sure which if any of the subsidiary questions (which I think you would have better chosen to comment on or ignore) you're answering here...â Croad Langshan
Jul 28 at 22:04
1
1
@JdeBP yes I saw the other question, I just think you both misinterpreted this one.
â Croad Langshan
Jul 28 at 22:05
@JdeBP yes I saw the other question, I just think you both misinterpreted this one.
â Croad Langshan
Jul 28 at 22:05
 |Â
show 8 more comments
up vote
1
down vote
The dot command was introduced by the Bourne Shell most likely in 1976.
The source command was introduced by the csh in 1977 or 1978.
So there is not an alias relation but two different names for an "invention" at the same time.
BTW: I can tell you why cd
is named this way. The command previously had been called chdir
, but this was too long (slow to type) for the upcoming 110 Baud modems in 1974...
3
source
could be even older, since it was a command in the Michigan terminal system.
â xenoid
Jul 29 at 0:21
source
is an obvious name, but I doubt that Bill Joy did know the MTS.
â schily
Jul 29 at 7:44
add a comment |Â
up vote
1
down vote
The dot command was introduced by the Bourne Shell most likely in 1976.
The source command was introduced by the csh in 1977 or 1978.
So there is not an alias relation but two different names for an "invention" at the same time.
BTW: I can tell you why cd
is named this way. The command previously had been called chdir
, but this was too long (slow to type) for the upcoming 110 Baud modems in 1974...
3
source
could be even older, since it was a command in the Michigan terminal system.
â xenoid
Jul 29 at 0:21
source
is an obvious name, but I doubt that Bill Joy did know the MTS.
â schily
Jul 29 at 7:44
add a comment |Â
up vote
1
down vote
up vote
1
down vote
The dot command was introduced by the Bourne Shell most likely in 1976.
The source command was introduced by the csh in 1977 or 1978.
So there is not an alias relation but two different names for an "invention" at the same time.
BTW: I can tell you why cd
is named this way. The command previously had been called chdir
, but this was too long (slow to type) for the upcoming 110 Baud modems in 1974...
The dot command was introduced by the Bourne Shell most likely in 1976.
The source command was introduced by the csh in 1977 or 1978.
So there is not an alias relation but two different names for an "invention" at the same time.
BTW: I can tell you why cd
is named this way. The command previously had been called chdir
, but this was too long (slow to type) for the upcoming 110 Baud modems in 1974...
edited Jul 29 at 2:24
slmâ¦
232k65479649
232k65479649
answered Jul 28 at 21:39
schily
8,39221435
8,39221435
3
source
could be even older, since it was a command in the Michigan terminal system.
â xenoid
Jul 29 at 0:21
source
is an obvious name, but I doubt that Bill Joy did know the MTS.
â schily
Jul 29 at 7:44
add a comment |Â
3
source
could be even older, since it was a command in the Michigan terminal system.
â xenoid
Jul 29 at 0:21
source
is an obvious name, but I doubt that Bill Joy did know the MTS.
â schily
Jul 29 at 7:44
3
3
source
could be even older, since it was a command in the Michigan terminal system.â xenoid
Jul 29 at 0:21
source
could be even older, since it was a command in the Michigan terminal system.â xenoid
Jul 29 at 0:21
source
is an obvious name, but I doubt that Bill Joy did know the MTS.â schily
Jul 29 at 7:44
source
is an obvious name, but I doubt that Bill Joy did know the MTS.â schily
Jul 29 at 7:44
add a comment |Â
up vote
0
down vote
As far as Bash is concerned the .
and source
are not aliases for one or the other, it's a simple fact that they're both builtins which call the same underlying function, source_builtin
.
Take a look at the source.def
file from the Bash source code:
$PRODUCES source.c
$BUILTIN source
$FUNCTION source_builtin
$SHORT_DOC source filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
$BUILTIN .
$DOCNAME dot
$FUNCTION source_builtin
$SHORT_DOC . filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
References
- path: root/builtins/source.def
- What is the difference between âÂÂsourceâ and âÂÂ.âÂÂ?
add a comment |Â
up vote
0
down vote
As far as Bash is concerned the .
and source
are not aliases for one or the other, it's a simple fact that they're both builtins which call the same underlying function, source_builtin
.
Take a look at the source.def
file from the Bash source code:
$PRODUCES source.c
$BUILTIN source
$FUNCTION source_builtin
$SHORT_DOC source filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
$BUILTIN .
$DOCNAME dot
$FUNCTION source_builtin
$SHORT_DOC . filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
References
- path: root/builtins/source.def
- What is the difference between âÂÂsourceâ and âÂÂ.âÂÂ?
add a comment |Â
up vote
0
down vote
up vote
0
down vote
As far as Bash is concerned the .
and source
are not aliases for one or the other, it's a simple fact that they're both builtins which call the same underlying function, source_builtin
.
Take a look at the source.def
file from the Bash source code:
$PRODUCES source.c
$BUILTIN source
$FUNCTION source_builtin
$SHORT_DOC source filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
$BUILTIN .
$DOCNAME dot
$FUNCTION source_builtin
$SHORT_DOC . filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
References
- path: root/builtins/source.def
- What is the difference between âÂÂsourceâ and âÂÂ.âÂÂ?
As far as Bash is concerned the .
and source
are not aliases for one or the other, it's a simple fact that they're both builtins which call the same underlying function, source_builtin
.
Take a look at the source.def
file from the Bash source code:
$PRODUCES source.c
$BUILTIN source
$FUNCTION source_builtin
$SHORT_DOC source filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
$BUILTIN .
$DOCNAME dot
$FUNCTION source_builtin
$SHORT_DOC . filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
References
- path: root/builtins/source.def
- What is the difference between âÂÂsourceâ and âÂÂ.âÂÂ?
answered Jul 29 at 2:37
slmâ¦
232k65479649
232k65479649
add a comment |Â
add a comment |Â
4
You actually have it backwards
â Jesse_b
Jul 28 at 19:51
2
.
is not an alias in the first place; nor is it a secondary name. This question takes a falsehood as its premise and, as demonstrated by the answers so far, is unanswerable except to say that the question is wrong, as such loaded questions are.â JdeBP
Jul 28 at 22:11
@JdeBP Actually, I tried
alias source
andalias .
in order to know which one was the alias of the other but got no response from the command line. Now I understand why. Hence, I supposed that.
was the alias because it was the shortest. I edited the question to make it clearer that the question is actually wrong. I did not change the title because it would change the meaning of the answers.â Arnaud Denoyelle
Jul 28 at 22:16
The next question can be found in the list that I collected two years ago at superuser.com/questions/1136409/#comment1631506_1136409 . (-:
â JdeBP
Jul 28 at 22:29
Possible duplicate - unix.stackexchange.com/questions/58514/â¦
â slmâ¦
Jul 29 at 2:54