2021-08-22 10:54:59 -04:00
|
|
|
#!/bin/rush
|
|
|
|
|
|
|
|
let x = %cat example.rsh%;
|
|
|
|
|
|
|
|
if x.contains("example") {
|
|
|
|
%echo It\\'s a script!%
|
|
|
|
}
|
|
|
|
|
|
|
|
if %echo some words%.contains("me wo") {
|
|
|
|
println!("But it's also Rust!");
|
|
|
|
}
|
|
|
|
|
|
|
|
let mem = %free -h%.lines().nth(1).unwrap()
|
|
|
|
.split_whitespace().nth(3).unwrap().to_owned();
|
|
|
|
|
2023-05-08 16:59:45 -04:00
|
|
|
let (_stdout, _stderr) = %^curl bob%;
|
|
|
|
println!("Collect stdout and stderr separately!");
|
|
|
|
|
2021-08-22 10:54:59 -04:00
|
|
|
// for i in 0..10000 {
|
|
|
|
// println!("x contains %% example? [{}]", x.contains("example"));
|
|
|
|
// }
|
|
|
|
|
2023-05-08 16:59:45 -04:00
|
|
|
%echo Double-up your percent signs to display them literally 100%%!%
|
|
|
|
|
2021-08-22 10:54:59 -04:00
|
|
|
println!("There are {} of memory free", &mem);
|