Dot (Unix)

Not to be confused with DOT (graph description language).

In a Unix shell, the full stop called the dot command (.) is a command that executes or opens a computer file. The filename is the dot command's first argument. One may specify parameters in a second argument. If no parameters are specified, the sourced file will receive the set of positional parameters available in the current context. If parameters are specified, the sourced file will receive only the specified parameters. In any case, parameter $0 will be the $0 of the current context.

The file does not have to be executable, but must be accessible from a directory defined in the PATH environment variable. The dot command is often used to define environment variables that are accessible within the current process. In contrast to file executed directly as an executable, there won't be a new process opened and the environment definitions defined within apply to the current process or the current shell.

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).

See also

External links

This article is issued from Wikipedia - version of the Thursday, August 13, 2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.