In fish shell, how can I put two conditions in an if statement?
This way works, but it is an ugly hack:
> if test (true; and echo y); echo y; else; echo n; end
y
> if test (false; and echo y); echo y; else; echo n; end
n
> if test (false; or true; and echo y); echo y; else; echo n; end
y
I sincerely hope for better answers.
Two other approaches:
Approach one:
if begin false; or true; end
echo y
else
echo n
end
Approach two:
false; or true
and echo y
or echo n