mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-30 17:41:14 -03:00
Switch \fish sections to rst format
This commit is contained in:
@@ -85,31 +85,34 @@ In assignment mode, `set` does not modify the exit status. This allows simultane
|
||||
|
||||
Examples
|
||||
------------
|
||||
\fish
|
||||
# Prints all global, exported variables.
|
||||
set -xg
|
||||
|
||||
# Sets the value of the variable $foo to be 'hi'.
|
||||
set foo hi
|
||||
|
||||
# Appends the value "there" to the variable $foo.
|
||||
set -a foo there
|
||||
::
|
||||
|
||||
# Does the same thing as the previous two commands the way it would be done pre-fish 3.0.
|
||||
set foo hi
|
||||
set foo $foo there
|
||||
# Prints all global, exported variables.
|
||||
set -xg
|
||||
|
||||
# Sets the value of the variable $foo to be 'hi'.
|
||||
set foo hi
|
||||
|
||||
# Appends the value "there" to the variable $foo.
|
||||
set -a foo there
|
||||
|
||||
# Does the same thing as the previous two commands the way it would be done pre-fish 3.0.
|
||||
set foo hi
|
||||
set foo $foo there
|
||||
|
||||
# Removes the variable $smurf
|
||||
set -e smurf
|
||||
|
||||
# Changes the fourth element of the $PATH array to ~/bin
|
||||
set PATH[4] ~/bin
|
||||
|
||||
# Outputs the path to Python if `type -p` returns true.
|
||||
if set python_path (type -p python)
|
||||
echo "Python is at $python_path"
|
||||
end
|
||||
|
||||
# Removes the variable $smurf
|
||||
set -e smurf
|
||||
|
||||
# Changes the fourth element of the $PATH array to ~/bin
|
||||
set PATH[4] ~/bin
|
||||
|
||||
# Outputs the path to Python if `type -p` returns true.
|
||||
if set python_path (type -p python)
|
||||
echo "Python is at $python_path"
|
||||
end
|
||||
\endfish
|
||||
|
||||
Notes
|
||||
------------
|
||||
|
||||
Reference in New Issue
Block a user