with-env
for env> with-env {flags} (variable) (block)
variable
: the environment variable to temporarily setblock
: the block to run once the variable is setinput | output |
---|---|
any | any |
Set the MYENV environment variable
>with-env [MYENV"my env value"] { $env.MYENV }
myenvvalue
Set by primitive value list
>with-env [XYWZ] { $env.X }
Y
Set by single row table
>with-env [[XW]; [YZ]] { $env.W }
Z
Set by key-value record
>with-env {X:"Y", W:"Z"} { [$env.X$env.W] }
╭───┬───╮
│0│Y│
│1│Z│
╰───┴───╯
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/with-env.html