New features in the fish shell
New features in the fish shell
Posted Sep 29, 2020 18:18 UTC (Tue) by ibukanov (subscriber, #3942)Parent article: New features in the fish shell
Posted Sep 30, 2020 17:54 UTC (Wed)
by glasserc (subscriber, #108472)
[Link] (3 responses)
Posted Sep 30, 2020 23:19 UTC (Wed)
by johannes (guest, #116140)
[Link] (1 responses)
Surprisingly, a condition for if/while consists of a command plus a tail of and/or commands, see https://github.com/fish-shell/fish-shell/blob/master/src/....
if cheap-condition; or expensive-condition-part-1; and expensive-condition-part-2
Although as a developer I agree that && and || look better.
Posted Oct 1, 2020 12:36 UTC (Thu)
by widowmaker (guest, #142307)
[Link]
Posted Oct 2, 2020 23:21 UTC (Fri)
by qlyoung (guest, #142338)
[Link]
I'm a long-time fish user who feels the opposite way. I really like the regular syntax of the fish shell language (no New features in the fish shell
[[
, then
, fi
, esac
) and introducing special syntax for and
and or
detracts from that. The linked discussion on Github also has additional arguments in both directions -- for example, &&
and &
function very differently despite their apparent visual similarity; but also, complicated boolean conditions in if
statements in fish
are a little clumsy because only the first command (until the first semicolon) is the condition, so &&
helps mitigate that.
New features in the fish shell
This means you can write chained conditions like this:
# body goes here
end
Using begin/end for grouping allows for more complex conditions.
New features in the fish shell
New features in the fish shell