Why Sponsor Oils? | source | all docs for version 0.19.0 | all versions | oilshell.org
Warning: Work in progress! Leave feedback on Zulip or Github if you'd like this doc to be updated.
This chapter in the Oils Reference describes special variables for OSH and YSH.
ARGV
Replacement for "$@"
_DIALECT
Name of a dialect being evaluated.
_this_dir
The directory the current script resides in. This knows about 3 situations:
oshrc
in an interactive shellosh myscript.sh
source
builtinIt's useful for "relative imports".
The version of Oil that is being run, e.g. 0.9.0
.
_status
Set by the try
builtin.
try ls /bad
if (_status !== 0) {
echo 'failed'
}
_pipeline_status
Alias for PIPESTATUS.
_process_sub_status
The exit status of all the process subs in the last command.
For the 'set' builtin.
For the 'shopt' builtin.
$HOME is used for:
Note: The shell doesn't set $HOME. According to POSIX, the program that invokes the login shell sets it based on /etc/passwd.
A colon-separated string that's used to find executables to run.
Used for word splitting. And the builtin split() function.
An array of words, split by : and = for compatibility with bash. New completion scripts should use COMP_ARGV instead.
Discouraged; for compatibility with bash.
Discouraged; for compatibility with bash.
Discouraged; for compatibility with bash.
User-defined completion functions should Fill this array with candidates. It is cleared on every completion request.
An array of partial command arguments to complete. Preferred over COMP_WORDS. The compadjust builtin uses this variable.
(An OSH extension to bash.)