You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] exec CMD ARGS expands its arguments twice, so substitutions run twice #261
letmut shell = Shell::builder().build().unwrap();
shell.run("exec echo $(echo once >> /tmp/count; echo x)").await;let out = shell.run("cat /tmp/count").await;println!("{:?}", out.stdout);
Expected Behavior
once\n — the substitution runs once, as in bash.
Actual Behavior
once\nonce\n — the substitution, and any side effect in it, runs twice.
Additional Context
src/exec.rs:2941-2955 (main @ c7c2202): exec expands its args to check whether they are empty, then throws the result away and re-runs the unexpanded words through execute_pipeline, which expands them again:
Activity