1DOT(1P)                    POSIX Programmer's Manual                   DOT(1P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       dot — execute commands in the current environment
14

SYNOPSIS

16       . file
17

DESCRIPTION

19       The shell shall execute commands from the file in the current  environ‐
20       ment.
21
22       If file does not contain a <slash>, the shell shall use the search path
23       specified by PATH to find the directory containing file.  Unlike normal
24       command  search, however, the file searched for by the dot utility need
25       not be executable. If no readable  file  is  found,  a  non-interactive
26       shell  shall  abort; an interactive shell shall write a diagnostic mes‐
27       sage to standard error, but this condition shall not  be  considered  a
28       syntax error.
29

OPTIONS

31       None.
32

OPERANDS

34       See the DESCRIPTION.
35

STDIN

37       Not used.
38

INPUT FILES

40       See the DESCRIPTION.
41

ENVIRONMENT VARIABLES

43       See the DESCRIPTION.
44

ASYNCHRONOUS EVENTS

46       Default.
47

STDOUT

49       Not used.
50

STDERR

52       The standard error shall be used only for diagnostic messages.
53

OUTPUT FILES

55       None.
56

EXTENDED DESCRIPTION

58       None.
59

EXIT STATUS

61       If  no readable file was found or if the commands in the file could not
62       be parsed, and the shell is interactive (and therefore does not  abort;
63       see Section 2.8.1, Consequences of Shell Errors), the exit status shall
64       be non-zero. Otherwise, return the value of the last command  executed,
65       or a zero exit status if no command is executed.
66

CONSEQUENCES OF ERRORS

68       Default.
69
70       The following sections are informative.
71

APPLICATION USAGE

73       None.
74

EXAMPLES

76       cat foobar
77       foo=hello bar=world
78       . ./foobar
79       echo $foo $bar
80       hello world
81

RATIONALE

83       Some older implementations searched the current directory for the file,
84       even if the value of PATH disallowed it. This behavior was omitted from
85       this  volume of POSIX.1‐2008 due to concerns about introducing the sus‐
86       ceptibility to trojan horses that the user might be trying to avoid  by
87       leaving dot out of PATH.
88
89       The  KornShell  version of dot takes optional arguments that are set to
90       the positional parameters.  This is a valid extension that allows a dot
91       script to behave identically to a function.
92

FUTURE DIRECTIONS

94       None.
95

SEE ALSO

97       Section 2.14, Special Built-In Utilities, return
98
100       Portions  of  this text are reprinted and reproduced in electronic form
101       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
102       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
103       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
104       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
105       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
106       event of any discrepancy between this version and the original IEEE and
107       The Open Group Standard, the original IEEE and The Open Group  Standard
108       is  the  referee document. The original Standard can be obtained online
109       at http://www.unix.org/online.html .
110
111       Any typographical or formatting errors that appear  in  this  page  are
112       most likely to have been introduced during the conversion of the source
113       files to man page format. To report such errors,  see  https://www.ker
114       nel.org/doc/man-pages/reporting_bugs.html .
115
116
117
118IEEE/The Open Group                  2013                              DOT(1P)
Impressum