1DOT(1P) POSIX Programmer's Manual DOT(1P)
2
3
4
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
12 dot — execute commands in the current environment
13
15 . file
16
18 The shell shall execute commands from the file in the current environ‐
19 ment.
20
21 If file does not contain a <slash>, the shell shall use the search path
22 specified by PATH to find the directory containing file. Unlike normal
23 command search, however, the file searched for by the dot utility need
24 not be executable. If no readable file is found, a non-interactive
25 shell shall abort; an interactive shell shall write a diagnostic mes‐
26 sage to standard error, but this condition shall not be considered a
27 syntax error.
28
30 None.
31
33 See the DESCRIPTION.
34
36 Not used.
37
39 See the DESCRIPTION.
40
42 See the DESCRIPTION.
43
45 Default.
46
48 Not used.
49
51 The standard error shall be used only for diagnostic messages.
52
54 None.
55
57 None.
58
60 If no readable file was found or if the commands in the file could not
61 be parsed, and the shell is interactive (and therefore does not abort;
62 see Section 2.8.1, Consequences of Shell Errors), the exit status shall
63 be non-zero. Otherwise, return the value of the last command executed,
64 or a zero exit status if no command is executed.
65
67 Default.
68
69 The following sections are informative.
70
72 None.
73
75 cat foobar
76 foo=hello bar=world
77 . ./foobar
78 echo $foo $bar
79 hello world
80
82 Some older implementations searched the current directory for the file,
83 even if the value of PATH disallowed it. This behavior was omitted from
84 this volume of POSIX.1‐2017 due to concerns about introducing the sus‐
85 ceptibility to trojan horses that the user might be trying to avoid by
86 leaving dot out of PATH.
87
88 The KornShell version of dot takes optional arguments that are set to
89 the positional parameters. This is a valid extension that allows a dot
90 script to behave identically to a function.
91
93 None.
94
96 Section 2.14, Special Built-In Utilities, return
97
99 Portions of this text are reprinted and reproduced in electronic form
100 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
101 table Operating System Interface (POSIX), The Open Group Base Specifi‐
102 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
103 Electrical and Electronics Engineers, Inc and The Open Group. In the
104 event of any discrepancy between this version and the original IEEE and
105 The Open Group Standard, the original IEEE and The Open Group Standard
106 is the referee document. The original Standard can be obtained online
107 at http://www.opengroup.org/unix/online.html .
108
109 Any typographical or formatting errors that appear in this page are
110 most likely to have been introduced during the conversion of the source
111 files to man page format. To report such errors, see https://www.ker‐
112 nel.org/doc/man-pages/reporting_bugs.html .
113
114
115
116IEEE/The Open Group 2017 DOT(1P)