Skip to content

Commit

Permalink
Add cat demonstration program
Browse files Browse the repository at this point in the history
Signed-off-by: Leni Aniva <[email protected]>
  • Loading branch information
lenianiva committed Aug 17, 2023
1 parent dd33850 commit fd91788
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/cat.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use rexpect::error::Error;
use rexpect::spawn;

fn main() -> Result<(), Error> {
let mut p = spawn("cat", Some(1000))?;

let ex: String = "∀".to_string();
p.send_line(&ex)?;
let line = p.read_line()?;

println!("In: {}", &ex);
println!("Out: {}", &line);
Ok(())
}

0 comments on commit fd91788

Please sign in to comment.