Skip to content

Glob including variables #12798

Answered by fdncred
cronhan asked this question in Q&A
May 7, 2024 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

You need to use into glob in that situation.

 let toml = "*.toml"
 ls $toml <-- fails as expected, similar to your example
Error:   × No matches found for DoNotExpand("*.toml")
   ╭─[entry #7:1:4]
 1  ls $toml
   ·    ──┬──
   ·      ╰── Pattern, file or folder not found
   ╰────
  help: no matches found


 ls ($toml | into glob)
╭─#─┬────────name─────────┬─type─┬─size──┬───modified───╮
 0  Cargo.toml           file  9,391  a day ago    
 1  Cross.toml           file    684  9 months ago 
 2  rust-toolchain.toml  file  1,125  3 weeks ago  
 3  typos.toml           file    509  a day ago    
╰───┴─────────────────────┴──────┴───────┴──────────────╯

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cronhan
Comment options

You must be logged in to vote
3 replies
@fdncred
Comment options

@cronhan
Comment options

@fdncred
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants