How to group multiple conditions in an if statement in fish
You can use begin
and end
for conditionals as well:
From fish tutorial:
For even more complex conditions, use begin and end to group parts of them.
For a simpler example, you can take a look at this answer from stackoverflow.
For your code, you just have to replace the (
with begin ;
and the )
with ; end
.
#!/usr/bin/fish
if begin ; false ; and true ; end ; or true
echo "true"
else
echo "false"
end
if false; and begin ; true ; or true ; end
echo "true"
else
echo "false"
end