You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yes, for bash scripts, we'll call out to bash. For your example, when you call out to the external command you may need to put \ in front of the semicolon.
We should fix that issue, but the \ should help you workaround it for now
If ; is nu's "operator" for bash's &&, what is nu's "operator" for bash's || ?
Reacted by Yage Hu, Míla, Oleksandr Bazhanov, Kuriko Moe, Md. Iftakhar Awal Chowdhury, Oleh Vanin, Steven Nugraha, Lucas Cândido, David P, Yiheng He and 5 more
I constantly run into issues with this. Many tools assume they can call commands like $SHELL 'command_a && command_b' (not sure about the exact syntax, but something to that effect).
If NuShell doesn't allow this, every other tool in the world needs to adapt to NuShell, which just won't happen for a long time.
I love NuShell, but this single issue is annoying as hell.
Wouldn't it be possible to treat command_a like an expression with exit code 0 evaluating to true and everything else evaluating to false?
Activity
sophiajt commentedon Nov 22, 2021
in nushell, we use
&&for conditions likeif $x < 10 && $y < 13. For the bash style&&, you can use;danimesq commentedon Nov 22, 2021
Here's another issue:

When using
;inside quotes, like in a git commit message:sophiajt commentedon Nov 22, 2021
@danimesq - can you file that one as a separate issue?
danimesq commentedon Nov 22, 2021
And how to switch
&&for;while not getting rid of nushell, so it can work usually without scaring away bash users?OK
sophiajt commentedon Nov 22, 2021
@danimesq unfortunately, if we tried to follow bash, we'd have a worse syntax (neither
&&nor<would work in the example above)danimesq commentedon Nov 22, 2021
Can bash scripts loaded in nushell still work using
&&?sophiajt commentedon Nov 22, 2021
yes, for bash scripts, we'll call out to bash. For your example, when you call out to the external command you may need to put
\in front of the semicolon.We should fix that issue, but the
\should help you workaround it for nowkubouch commentedon Nov 30, 2021
I'll close this since we don't plan adding a support for Bash-like
&&.danimesq commentedon Nov 30, 2021
Done and merged here: #4157.
avkonst commentedon Sep 30, 2022
If
;is nu's "operator" for bash's&&, what is nu's "operator" for bash's||?jondlm commentedon Apr 30, 2026
https://www.nushell.sh/commands/docs/try.html
nightscape commentedon Oct 13, 2026
I constantly run into issues with this. Many tools assume they can call commands like
$SHELL 'command_a && command_b'(not sure about the exact syntax, but something to that effect).If NuShell doesn't allow this, every other tool in the world needs to adapt to NuShell, which just won't happen for a long time.
I love NuShell, but this single issue is annoying as hell.
Wouldn't it be possible to treat
command_alike an expression with exit code0evaluating totrueand everything else evaluating tofalse?