Execute a system command: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,252: | Line 1,252: | ||
<lang runbasic>print shell$("ls") ' prints the returned data from the OS |
<lang runbasic>print shell$("ls") ' prints the returned data from the OS |
||
a$ = shell$("ls") ' holds returned data in a$</lang> |
a$ = shell$("ls") ' holds returned data in a$</lang> |
||
=={{header|Rust}}== |
|||
<lang rust>use std::process::Command; |
|||
fn main() { |
|||
let output = Command::new("ls").output().unwrap_or_else(|e| { |
|||
panic!("failed to execute process: {}", e) |
|||
}); |
|||
println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); |
|||
} |
|||
</lang> |
|||
=={{header|Scala}}== |
=={{header|Scala}}== |