-
Good day, new-ish on-and-off user here. > set a
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\user\AppData\Roaming Same thing in PowerShell: > Get-ChildItem env:a*
Name Value
---- -----
APPDATA C:\Users\user\AppData\Roaming
ALLUSERSPROFILE C:\ProgramData How can I accomplish the same in nu? Things I have tried that do not work: ~> $env.a*
Error: nu::shell::column_not_found
~> $env | select a*
Error: nu::shell::column_not_found
~> $env | str starts-with 'a'
Error: nu::shell::only_supports_this_input_type
~> $env | any {|| $in.startswith "a"}
Error: nu::parser::parse_mismatch |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
$env | transpose key value | where ($it.key | str starts-with 'a') since and now we can use |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the detailed explanation! My next task is to make my first function using this knowledge :) |
Beta Was this translation helpful? Give feedback.
since
$env
is a record and not a table we first have to transpose it to one in order to make it properly iterable. ->transpose key value
and now we can use
where
, which filters a list/table (and it allows the use of the spicial variable$it
)