DOT(1P)
π DOT(1P) β the POSIX Programmer's Manual, bestie edition π
okay so this is the POSIX Programmer's Manual page for dot, and I'm gonna hold your hand through it like the group chat does before a group project. quick heads-up before we even start:
π¨ PROLOG (read this first, fr fr)
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β so bestie, consult the corresponding Linux manual page for details of Linux behavior β or honestly? the interface may not be implemented on Linux at all. π
β¨ NAME β¨
dot β execute commands in the current environment. that's it. that's the whole vibe. it runs stuff, but in your environment, not a lil baby subshell one. π
π¦ SYNOPSIS π¦
. file
that's a single period followed by a filename, and yes it's iconic, yes it's tiny.
πΈ DESCRIPTION πΈ
The shell shall execute commands from the file in the current environment. not a copy, not a spawn, the actual current one. that's the whole point and it's lowkey why people are obsessed.
If file does not contain a <slash>, the shell shall use the search path specified by PATH to find the directory containing file. BUT β and this is the plot twist β unlike normal command search, the file searched for by the dot utility need not be executable. it just needs to be readable, periodt.
If no readable file is found:
- a non-interactive shell shall abort. like, gone. π
- an interactive shell shall write a diagnostic message to standard error, but this condition shall not be considered a syntax error.
so the interactive shell lives to fight another day. she's resilient.
π OPTIONS π
None. literally zero. nothing to configure. she simply is. π
π OPERANDS π
See the DESCRIPTION. (yeah, they really said that. the file operand is the whole thing.)
π STDIN π
Not used. don't even think about it.
π INPUT FILES π
See the DESCRIPTION. (again. it's the file. that's the input file. slay.)
π ENVIRONMENT VARIABLES π
See the DESCRIPTION. (PATH is the star of the show here, iykyk.)
β ASYNCHRONOUS EVENTS β
Default. no notes.
π¦ STDOUT π¦
Not used. she doesn't talk, she just does.
π STDERR π
The standard error shall be used only for diagnostic messages. that's her one job and she does it beautifully.
π§ OUTPUT FILES π§
None. zero. nada.
π«Ά EXTENDED DESCRIPTION π«Ά
None. this page is refreshingly short and we love her for it.
π EXIT STATUS π
okay bestie, here's where it gets real. If no readable file was found, or if the commands in the file could not be parsed, and the shell is interactive (and therefore does not abort; see Section 2.8.1, Consequences of Shell Errors), the exit status shall be non-zero.
Otherwise, return the value of the last command executed, or a zero exit status if no command is executed. so basically: whatever the last thing in the file did, that's your status. simple. clean. iconic.
π CONSEQUENCES OF ERRORS π
Default.
The following sections are informative.
πΈ APPLICATION USAGE πΈ
None. we're all just vibing.
β¨ EXAMPLES β¨
look at this lil demo, it's so cute:
cat foobar
foo=hello bar=world
. ./foobar
echo $foo $bar
hello world
see how foo and bar survived past the . call? that's the current-environment thing doing its thing. main character energy. π«Ά
π RATIONALE π
Some older implementations searched the current directory for the file, even if the value of PATH disallowed it. This behavior was omitted from this volume of POSIX.1β2017 due to concerns about introducing the susceptibility to trojan horses that the user might be trying to avoid by leaving dot out of PATH. so likeβ¦ yeah. that was a security jumpscare and we said no thank you. π«π΄
The KornShell version of dot takes optional arguments that are set to the positional parameters. This is a valid extension that allows a dot script to behave identically to a function. cute! that's not in this volume tho, just so we're clear. π
π₯ FUTURE DIRECTIONS π₯
None. she's perfect as she is.
π SEE ALSO π
- Section 2.14, Special Built-In Utilities
return
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie!! this iconic lil number is brought to you by IEEE/The Open Group, 2017, and it's filed under DOT(1P). go forth and source responsibly. π¦β¨π
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms