A command built into every *n?x shell, "." (pronounced "source") will read text from the file named by its first command-line argument and treat it as input to the shell. This is similar to running the file as a shell script, but instead of commands being run in a separate shell process, they are run in the current shell process. Any additional command-line parameters are treated as parameters to the script being run.

While the technique conserves the number of active processes, there is a far more important reason to "source" a script instead of running it in a separate process: to use the script to set an environment variable in the calling shell, or to define a shell function in the calling shell.

For example, here's a little shell to add validated directory names to the PATH environment variable without duplicating the path name in the string:

#!(@) /bin/sh
# ---------- file name -- addpath ---------

for d in $@
    if [
       then case "::$PATH::" in
                 *:$d:*) ;;
                 *)      PATH=$PATH:$d
       else echo "$d is not a directory" >&2
export PATH
if [ "$addpath_ec" -eq '0' ]
   then unset addpath_ec
   else unset addpath_ec

You would invoke the script by typing

. addpath path

at the command-line prompt. An example session might go:

$ echo $PATH
$ . addpath i_dont_exist
i_dont_exist is not a directory.
$ echo $?
$ . addpath /usr/local/bin
$ echo $?
$ echo $PATH

A symbol often referred to by the name "period". It is also often called the "full stop", particularly in the UK.

In most modern languages (including English) it is used as a separator, placed at the end of each sentence to signify the sentence is over. It is often also used after each letter within an acronym.

In North America and Australia, it is used as a separator to denote place value in a decimal-based fraction, i.e. 2.25 would be two and 25/100ths. In countries that follow SI strictly, such as those in South America or Europe, this is done with the comma, and the period is used as a separator for clarity placed every third digit, i.e. 10.000 for ten thousand. In America this is done with the comma. In perl, the period is used for decimal-fraction place value, and the underscore is used for arbitrary clarity divisions.

In many computing environments, the period is traditionally used as a separator between a file's name and its extension, the extension being used to denote file type. A file named index.html would be a file named index of type html.

In internet domain names, the period is used as a separator between TLD, domain, and any subdomains.

In C-like programming languages, the period is used as a separator to denote that the thing after the period is "inside" of the thing before the period; for example, thing1.thing2 would request an item (named thing2) inside of a specific variable (named thing1) which is a structure, class or union containing a variable (named thing2).

Perl also uses the period as a kind of string concatenation operator; (string1 . string2) would return a value equal to a string containing the contents of string1 followed by the contents of string2. It also uses . as a single-character-length wildcard in regular expressions.

In UNIX-like systems, any file with a name beginning with a . is viewed as being invisible. Also, each directory is traditionally viewed as containing an imaginary directory named ".", which is equivalent to the directory that contains the . directory. So if you need to give something a directory to operate on, and you want it to operate on the current directory, you give it the name of the . directory. Because the directory's name begins with a ., the directory is invisible. You mostly see it used when you are trying to run a program in the current directory-- most command-line shells require exact pathnames for programs not in in certain places, so to run a program in the current directory you have to give the shell an exact pathname by saying ./programtorun.See also ...

In SMTP, and thus most command-line mail clients (mailx, for example) a . alone on a line signifies the end of the e-mail.

The ASCII value of . is 46.


First, for purposes of clarity, . will be written as (dot), (period), (radix), etc. for the remainder of this writeup. Acceptable pronunciations of (dot) include "dot," "period," "point," "mark," and "radix" depending on context.

  • In grammar, (dot) is referred to as a period and is used to end a non-interrogative, non-exclamatory sentence. For this reason, it is the punctuation mark of choice for most sentence writers. After all, most things written are neither questions nor exclamations. (period) is also used to signal the end of an abbreviation. A semi-notable exception to this rule is the soft drink Dr Pepper which, despite not ending its abbreviation with a (period) is still read as "Doctor Pepper."

  • In the realm of mathematics, (dot) is known as radix or decimal point1. The (radix) signifies the division between whole parts and fractional parts of numbers. For example, in 3.510, there are three whole parts and 5 tenths of whatever is being counted. It should be noted that German mathematics use the comma in the same way American mathematics use the (dot) (I can't speak for others) so the preceding point does not apply to them.

    Also in the realm of mathematics, (dot) is used as the multiplication operator. The transition from x to (dot) usually occurs when one begins learning algebra, as x is the most popular algebra variable name known to man. When one begins to learn higher level geometry, (dot) also becomes known as the dot operator. The dot operator is used to determine the dot product of two vectors. In both cases, (dot) used as a mathematical operator, it is centered vertically.

  • In textbooks (and other printed documents), (dot) is often used as a section separator. Instead of forcing an author to number his/her sections 1, 2, 3, 4, etc., s/he can use the . to specify to the reader that sections are related to one another. Sections 1 and 2 may be related, but one can't be certain. Sections 1.1 and 1.2, however, are almost assuredly related.

  • In product releases (most notably computer software), (dot) is known as (point) and separates major release numbers from minor release numbers. For example, version 4.2 of your favorite product has most likely undergone 4 major revisions (or rewrites) and had 2 minor patches applied. Version 4.3 may not be worth your time, but version 5 will be if this product is important to you and/or exceedingly useful.

  • In computing, (dot) is used to separate a file name from its extension. In myprog.exe, myprog is the file name, and exe is the extension (signifying executable, in this case). In URLs/URIs, (dot) is used as a delimiter in the authority field. For example, in http://www.everything2.com/index.pl?node=124, www.everything2.com is the authority field.

  • In computer programming, (dot) means many things. It is used as the concatenation operator in PHP and Perl2. In C, C++, C#, Delphi, Jade, Java, JavaScript, Python, and VB, (dot) is used to access member variables and functions of classes.C# also uses (dot) to qualify namespaces. Pascal uses (dot) to access record members and end a program with the end. statement. Lua uses (dot) to access members of a table. Finally, in COBOL, (dot) is used to mark the end of a statement.

1 - It's only correctly referred to as decimal point when working in the base 10 number system. Radix is easier to remember when you switch bases a lot, and "octal point," "hexadecimal point," and "binary point" sound funny.
2 - Perl will cease to use (dot) as the concatenation operator as of version 6 because it will be used to access member variables and function. (underscore) will be used for concatenation.

Thanks to Jurph for help with the pronunciations and some gramattical fixes.
Thanks to StrawberryFrog for fleshing out the list of languages that use (dot) for accessing class members and the namespace information for C#.
Thanks to RPGeek for reminding me that mathematical (dot) is aligned differently than all other (dot)s.
Thanks to BlackPawn for informing me that Jade also uses (dot) for accessing class members.
Thanks to small for enlightening me about the German mathematical system's use of the comma.
Thanks to OldMiner for the Lua information.
Thanks to ariels for the Pascal information

It's amazing we didn't have a writeup on (dot) already. Everybody knows something about it that I didn't. This node has taught me a lot...and I wrote it! Thanks for all the help. You guys are fantastic.

The languages listed are not meant to be an exhaustive list. If your language of choice is not represented and you wish it was, /msg me, and I'll add it to the list.

09 March 2005 - Oops, it turns out we do already have a writeup on (dot). It's here.
10 April 2005 - This writeup was moved here from its prior unsearchable home, ..

Log in or register to write something here or to contact authors.