Dot (command)

Uses your system voice; voice and rate in settings.

Snapshot

≈ 3 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

In a Unix shell, the full stop called the dot command (.) is a command that evaluates commands in a computer file in the current execution context. In the C shell, a similar functionality is provided as the source command, and this name is seen in "extended" POSIX shells as well. The dot command is not to be confused with a dot file, which is a dot-prefixed hidden file or hidden directory. Nor is it to be confused with the ./scriptfile notation for running commands, which is simply a relative path pointing to the current directory (notated in Unix as a '.' character, and typically outside of the Path variable).

In a Unix shell, the full stop called the dot command (.) is a command that evaluates commands in a computer file in the current execution context. In the C shell, a similar functionality is provided as the source command, and this name is seen in "extended" POSIX shells as well. The dot command is not to be confused with a dot file, which is a dot-prefixed hidden file or hidden directory. Nor is it to be confused with the ./scriptfile notation for running commands, which is simply a relative path pointing to the current directory (notated in Unix as a '.' character, and typically outside of the Path variable). == source == source is a shell built-in command that evaluates the file following the command, as a list of commands, executed in the current context. Frequently the "current context" is a terminal window into which the user is typing commands during an interactive session. The source command can be abbreviated as just a dot ( . ) in Bash and similar POSIX-ish shells. However, this is not acceptable in C shell, where the command first appeared. Some Bash scripts should be run using the source your-script syntax rather than run as an executable command, e.g., if they contain a change directory ( cd ) command and the user intends that they be left in that directory after the script is complete, or they contain an export command and the user wants to modify the environment of the current shell. Another usage situation is when a script file does not have the "execute" permission. Passing the script filename to the desired shell will run the script in a subshell, not the current context. ==External links== The three different uses of the dot in Unix explained

Text derived from https://en.wikipedia.org/w/index.php?oldid=1378831395 under CC BY-SA 4.0; modifications have been made.