mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
fish_for_bash_users: Put explanation on subshells first
and *then* explain things that aren't subshells.
This commit is contained in:
parent
b6bebec513
commit
fc5eb0a98a
1 changed files with 2 additions and 2 deletions
|
@ -417,6 +417,8 @@ This includes things like:
|
|||
baz &
|
||||
done
|
||||
|
||||
Fish does not currently have subshells. You will have to find a different solution. The isolation can usually be achieved by just scoping variables (with ``set -l``), but if you really do need to run your code in a new shell environment you can use ``fish -c 'your code here'`` to do so explicitly.
|
||||
|
||||
``()`` subshells are often confused with ``{}`` grouping, which does *not* use a subshell. When you just need to group, you can use ``begin; end`` in fish::
|
||||
|
||||
(foo; bar) | baz
|
||||
|
@ -437,8 +439,6 @@ The pipe will simply be run in the same process, so ``while read`` loops can set
|
|||
|
||||
Subshells are also frequently confused with :ref:`command substitutions <bash-command-substitutions>`, which bash writes as ```command``` or ``$(command)`` and fish writes as ``$(command)`` or ``(command)``. Bash also *uses* subshells to implement them.
|
||||
|
||||
The isolation can usually be achieved by just scoping variables (with ``set -l``), but if you really do need to run your code in a new shell environment you can always use ``fish -c 'your code here'`` to do so explicitly.
|
||||
|
||||
Builtins and other commands
|
||||
---------------------------
|
||||
|
||||
|
|
Loading…
Reference in a new issue