summaryrefslogtreecommitdiff
path: root/Base
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-08-18 02:11:42 +0430
committerAndreas Kling <kling@serenityos.org>2020-08-18 16:58:17 +0200
commit68189f80ccbf89ea20901be691e13747d2eb21ef (patch)
treefe5b66924dc48c72e69229ca5372a5705149bc3c /Base
parent32bfb485775cd9d36e9057ed0a5c613feed8c156 (diff)
downloadserenity-68189f80ccbf89ea20901be691e13747d2eb21ef.zip
Shell: Document the use of environment/local variables
Diffstat (limited to 'Base')
-rw-r--r--Base/usr/share/man/man1/Shell.md4
-rw-r--r--Base/usr/share/man/man7/Shell-vars.md37
2 files changed, 41 insertions, 0 deletions
diff --git a/Base/usr/share/man/man1/Shell.md b/Base/usr/share/man/man1/Shell.md
index 0705124d5b..1d480dac8c 100644
--- a/Base/usr/share/man/man1/Shell.md
+++ b/Base/usr/share/man/man1/Shell.md
@@ -38,3 +38,7 @@ Shell -c 'rm foo*'
# Execute the contents of a file with some arguments
Shell foo a b c
```
+
+## See also
+
+* [`Shell-vars`(7)](../man7/Shell-vars.md) For details on local and environment variables used by the shell
diff --git a/Base/usr/share/man/man7/Shell-vars.md b/Base/usr/share/man/man7/Shell-vars.md
new file mode 100644
index 0000000000..d5a653eff0
--- /dev/null
+++ b/Base/usr/share/man/man7/Shell-vars.md
@@ -0,0 +1,37 @@
+## Name
+
+Shell Variables - Special local and environment variables used by the Shell
+
+## Description
+
+The Shell uses various variables to allow for customisations of certain behavioural or visual things.
+Such variables can be changed or set by the user to tweak how the shell presents things.
+
+## Behavioural
+
+1. Output interpretations
+
+`IFS` (local)
+
+The value of this variable is used to join lists or split strings into lists, its default value is a newline (`\\n`).
+
+
+## Visual
+
+2. Prompting
+
+`PROMPT` (environment)
+
+The value of this variable is used to generate a prompt, the following escape sequences can be used literally inside the value, and they would expand to their respective values:
+- `\\u` : the current username
+- `\\h` : the current hostname
+- `\\w` : a collapsed path (relative to home) to the current directory
+- `\\p` : the string '$' (or '#' if the user is 'root')
+
+Any other escaped character shall be ignored.
+
+
+`PROMPT_EOL_MARK` (environment)
+
+The value of this variable is used to denote the ends of partial lines (lines with no newline), its default value is '%'.
+