Last active
September 26, 2019 07:55
-
-
Save rming/27911edda129828665a02060eca0f029 to your computer and use it in GitHub Desktop.
What is the difference between dot and "source" ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/sbin/sh | |
| source /sdcard/bash_init.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/sbin/sh | |
| . /sdcard/bash_init.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The only difference is in portability. . is | |
| the POSIX-standard command for executing commands from a file; | |
| source is a more-readable synonym provided by bash and some other shells. | |
| bash itself, however, makes no distinction between the two. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment