Closed
Description
I tried this code:
use std::process::Command;
...
let s = Command::new("echo")
.arg("$123")
.output()
.expect("command failed");
println!("{}", String::from_utf8_lossy(&s.stdout));
I expected to see this happen:
Print the content of the $123 environment variable
Instead, this happened:
It literally prints $123
Meta
rustc --version --verbose
:
rustc --version --verbose
rustc 1.61.0-nightly (63b8f01bb 2022-03-24)
binary: rustc
commit-hash: 63b8f01bb5ca277e7df8d7efe094ed4244c1790c
commit-date: 2022-03-24
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0
Metadata
Metadata
Assignees
Labels
Area: Documentation for any part of the project, including the compiler, standard library, and toolsArea: `std::process` and `std::env`Category: An issue proposing an enhancement or a PR with one.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Relevant to the library team, which will review and decide on the PR/issue.