aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/set.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc_src/set.txt')
-rw-r--r--doc_src/set.txt18
1 files changed, 10 insertions, 8 deletions
diff --git a/doc_src/set.txt b/doc_src/set.txt
index 4acbbf17..cbdd0f15 100644
--- a/doc_src/set.txt
+++ b/doc_src/set.txt
@@ -82,19 +82,21 @@ success, with a non-zero exit status if the commandline was invalid, if the
variable was write-protected or if the variable did not exist.
\subsection set-example Example
+\fish
+set -xg
+# Prints all global, exported variables.
-`set -xg` will print all global, exported variables.
-
-`set foo hi` sets the value of the variable foo to be hi.
+set foo hi
+# Sets the value of the variable $foo to be 'hi'.
-`set -e smurf` removes the variable `smurf`.
+set -e smurf
+# Removes the variable $smurf
-`set PATH[4] ~/bin` changes the fourth element of the `PATH` array to `~/bin`
+set PATH[4] ~/bin
+# Changes the fourth element of the $PATH array to ~/bin
-\fish
if set python_path (which python)
echo "Python is at $python_path"
end
+# Outputs the path to Python if `which` returns true.
\endfish
-
-The above outputs the path to Python if `which` returns true.