I've spent some quality time searching the POSIX standard for the shell for the source
and .
commands, and am at this point convinced that they're just not in there.
Are there any shells that don't support the .
? What is the POSIX-standard way of executing a shell script in the current environment (i.e., not spawning a subshell, so if the script says export VAR=value
then VAR
exists in the calling shell)?
I might be missing something obvious, but it turns out that .
is not very easy to Google...
POSIX standards define application programming interfaces (API) at both the system and user levels and command-line shells and utility interfaces for software compatibility and/or portability with various distributions of the Unix Operating System and other operating systems as well.
fish, the friendly interactive shell, is a commandline shell intended to be interactive and user-friendly. fish is intentionally not fully POSIX compliant, it aims at addressing POSIX inconsistencies (as perceived by the creators) with a simplified or a different syntax.
Some popular shell languages are POSIX-compliant (Bash, Korn shell), but even they offer additional non-POSIX features which will not always function on other shells. The commands test expression is identical to the command [expression] . In fact, many sources recommend using the brackets for better readability.
Other shells Bash (the Bourne-Again shell) was developed in 1989 for the GNU project and incorporates features from the Bourne shell, csh, and ksh. It is meant to be POSIX-compliant.
It's there under "dot".
NAME
dot - execute commands in the current environment
SYNOPSIS
. file
[etc.]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With