diff --git a/doc_src/fish_for_bash_users.rst b/doc_src/fish_for_bash_users.rst index c462c7f2c..1a5fbb1e5 100644 --- a/doc_src/fish_for_bash_users.rst +++ b/doc_src/fish_for_bash_users.rst @@ -73,6 +73,8 @@ See :ref:`Shell variables ` for more. .. [#] zsh also does not perform word splitting by default (the SH_WORD_SPLIT option controls this) +.. _bash-globs: + Wildcards (globs) ----------------- @@ -221,16 +223,22 @@ Fish does not have ``$((i+1))`` arithmetic expansion, computation is handled by math $i + 1 -It can handle floating point numbers:: +Unlike bash's arithmetic, it can handle floating point numbers:: > math 5 / 2 2.5 -And also hase some functions, like for trigonometry:: +And also has some functions, like for trigonometry:: > math cos 2 x pi 1 +You can pass arguments to ``math`` separately like above or in quotes. Because fish uses ``()`` parentheses for :ref:`command substitutions `, quoting is needed if you want to use them in your expression:: + + > math '(5 + 2) * 4' + +Both ``*`` and ``x`` are valid ways to spell multiplication, but ``*`` needs to be quoted because it looks like a :ref:`glob `. + Prompts ------- diff --git a/doc_src/language.rst b/doc_src/language.rst index f37dd1414..decbcbd3d 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -564,8 +564,8 @@ That means quoting isn't the absolute necessity it is in other shells. Most of t .. [#] Unlike bash or zsh, which will join with the first character of $IFS (which usually is space). -Derefencing variables -''''''''''''''''''''' +Dereferencing variables +''''''''''''''''''''''' The ``$`` symbol can also be used multiple times, as a kind of "dereference" operator (the ``*`` in C or C++), like in the following code::