Content deleted Content added
Blisswelness (talk | contribs) m some mispelled words |
|||
Line 35:
<syntaxhighlight lang="fish">
# Variable assignment
# # #
▲# command easily extends to work with arrays, scoping, etc.
> set foo bar
> echo $foo
bar
# Command substitution
#
#
# Fish doesn't use backticks (``), which can't be nested and may be confused with single quotes (' ').
> set wd (pwd)
> set wd $(pwd) # since version 3.4
Line 70 ⟶ 74:
convert $i (basename $i .jpg).png
end
# fish supports multi-line history and editing.▼
# Semicolons work like newlines:
> for i in *.jpg; convert $i (basename $i .jpg).png; end
▲# fish supports multi-line history and editing.
# while-loop, read lines /etc/passwd and output the fifth
Line 89 ⟶ 95:
=== No implicit subshell ===
Some language constructs, like [[pipeline (software)|pipelines]], [[subroutine|functions]] and [[control flow#Loops|loops]], have been implemented using so called subshells in other [[shell (computing)|shell]] languages. Subshells are
<syntaxhighlight lang="fish">
# This will not work in many other shells, since the 'read' builtin
|