-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Unexpected interpolation in argument for script #7936
Copy link
Copy link
Closed
Labels
A:quoting-expansionIssues related to string quoting, interpolation, and expansion of variable or glob patternsIssues related to string quoting, interpolation, and expansion of variable or glob patterns
Description
Describe the bug
When a non-interpolated string containing ( or () is passed to a nu script file, nu tries to interpolate it, if none of the parentheses are adjacent to or contain a whitespace or a (already escaped) backslash.
How to reproduce
"#!/usr/bin/env nu\ndef main [str] {echo $str}" | save test; chmod +x test./test '(aaaa)'yields the external command failed error (assuming there is no real command calledaaaa)'(aa aa)','( aaaa)',' (aaaa)','\(aaaa)'vel sim. are just printed- However,
"(date\tnow)"will print like$"(date now)"
Expected behavior
I expect nu to treat these strings in accordance with the expected behavior as documented
Screenshots
Since ($env.config) didn't print the config record, it probably is a problem in the nu process that runs the script, not the shell
Configuration
| key | value |
|---|---|
| version | 0.75.0 |
| branch | |
| commit_hash | |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.65.0 (897e37553 2022-11-02) |
| rust_channel | stable-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.65.0 (4bc8f24d3 2022-10-20) |
| pkg_version | 0.75.0 |
| build_time | 2023-02-01 07:12:44 +08:00 |
| build_rust_channel | release |
| features | database, dataframe, default, trash, which, zip |
| installed_plugins |
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:quoting-expansionIssues related to string quoting, interpolation, and expansion of variable or glob patternsIssues related to string quoting, interpolation, and expansion of variable or glob patterns

