Skip to content

Commit d008a6e

Browse files
committed
create basic shell
1 parent 3db4b53 commit d008a6e

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "Rusty-Shell"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]

src/main.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
fn main(){
2+
let mut input = String::new();
3+
stdin().read_line(&mut input).unwrap();
4+
5+
// read_line leaves a trailing newline, which trim removes
6+
let command = input.trim();
7+
8+
Command::new(command)
9+
.spawn()
10+
.unwrap();
11+
}

0 commit comments

Comments
 (0)