Nushell: How do I separate multiple commands?

Created on 30 Sep 2019  路  4Comments  路  Source: nushell/nushell

Is there a way to separate multiple commands such as I would normally do with a semicolon in bash?

git pull; git push

Would it make sense to add a feature like that?

enhancement

Most helpful comment

nu 0.13 has semicolon support, so this code works now:

git pull; git push

All 4 comments

This isn't yet supported, but we'd like to add support for it, or something like it.

900

To summarize, we have three ways of doing multiple commands in most other shells:

  1. a; b, always run both a and b
  2. a && b, only run b if a was successful
  3. a || b, only run b if a was unsuccessful

We don't really need (1) or (2) in scripts, but they're useful on the command-line . For example, when I go back through my history, I like using one-liners to re-run some set of commands. That being said, nu could take a completely different approach to this without sacrificing a good user experience. Something to think about 馃檪

nu 0.13 has semicolon support, so this code works now:

git pull; git push
Was this page helpful?
0 / 5 - 0 ratings