I want to access all the arguments and run the same command on each argument in the list.
#!/usr/bin/env nu
def main [ one, two ] {
// echo each item in the argument list
}
How to achieve this in nushell?
I want to access all the arguments and run the same command on each argument in the list.
#!/usr/bin/env nu
def main [ one, two ] {
// echo each item in the argument list
}
How to achieve this in nushell?
Copyright © 2021 Jogjafile Inc.
It sounds like you are looking for Rest parameters:
argscan be named whatever you want. The only "magic" variable in that example is$in, which could be replaced with the non-magic form: