Step 4 - Challenge: Commands With Arguments

In this step your goal is to be able to run external commands that take arguments, for example ls -la, or cat <filename>.

To do that we’ll need to capture the user input and then split it into parts, the command and the arguments to be passed to the command that we spawn. For example, I’ll run my shell and pass a filename to the cat program, which prints out to the terminal the contents of the file:

% ccsh
ccsh> cat cargo.lock
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3

[[package]]
name = "ccsh"
version = "0.1.0"
ccsh> exit
%