Quantcast
Channel: Active questions tagged fish - Stack Overflow
Viewing all articles
Browse latest Browse all 106

In fish shell, how can I put two conditions in an if statement?

$
0
0

What I want to do using bash:

> if true; then echo y; else echo n; fiy> if false; then echo y; else echo n; fin> if false || true; then echo y; else echo n; fiy

Now trying with fish:

> if true; echo y; else; echo n; endy> if false; echo y; else; echo n; endn# Here 'or true' are just two arguments for false> if false or true; echo y; else; echo n; end n# Here 'or true;' is a command inside the if> if false; or true; echo y; else; echo n; end n# Can't use command substitution instead of a command> if (false; or true); echo y; else; echo n; endfish: Illegal command name “(false; or true)”

How can I have two conditions in an if?


Viewing all articles
Browse latest Browse all 106

Trending Articles