This is some output from a run of my shell program. Note the jobs run in the background, the history command, and the !num commands.

# start my shell and run some commands in the forground and background
# (ls, ps, sleeper)

$ ./cs31shell

cs31shell> ls
Makefile     history_bash   myparseline.h  parsecmd.o	  sleeper.c
cs31shell    infloop.c	    parsecmd.c	   sample_output
cs31shell.c  myparseline.c  parsecmd.h	   sleeper

cs31shell> ls -l -a
total 84
drwx------ 2 newhall users  4096 Nov 10 20:42 .
drwx------ 4 newhall users  4096 Nov 10 20:16 ..
...

cs31shell> whoami
newhall

cs31shell> ./sleeper &

cs31shell> ./sleeper &

cs31shell> ./sleeper 10 &

cs31shell> ps w
  PID TTY      STAT   TIME COMMAND
12174 pts/3    Ss     0:00 bash
21553 pts/8    S+     0:00 ./cs31shell
21594 pts/8    S+     0:00 ./sleeper      # background job
21596 pts/8    S+     0:00 ./sleeper      # background job
21606 pts/8    S+     0:00 ./sleeper 10   # background job
21616 pts/8    R+     0:00 ps w

cs31shell> ./sleeper 20 &

cs31shell> ps w
  PID TTY      STAT   TIME COMMAND
12174 pts/3    Ss     0:00 bash
21553 pts/8    S+     0:00 ./cs31shell
21606 pts/8    S+     0:00 ./sleeper 10    # background job (previous one exited)
21626 pts/8    S+     0:00 ./sleeper 20    # background job
21627 pts/8    R+     0:00 ps w

cs31shell> blah
blah: command not found

cs31shell> ps w
  PID TTY      STAT   TIME COMMAND
12174 pts/3    Ss     0:00 bash
21553 pts/8    S+     0:00 ./cs31shell
21626 pts/8    S+     0:00 ./sleeper 20    # background job (sleeper 10& exited)
21666 pts/8    R+     0:00 ps w

cs31shell> history                     # print out history
     2  whoami
     3  ./sleeper &
     4  ./sleeper &
     5  ./sleeper 10 &
     6  ps w
     7  ./sleeper 20 &
     8  ps w
     9  blah
    10  ps w
    11  history

cs31shell> !4                          # runs: ./sleeper &

cs31shell> !10                         # runs: ps w
  PID TTY      STAT   TIME COMMAND
12174 pts/3    Ss     0:00 bash
21553 pts/8    S+     0:00 ./cs31shell
21626 pts/8    S+     0:00 ./sleeper 20
21686 pts/8    S+     0:00 ./sleeper
21687 pts/8    R+     0:00 ps w

cs31shell> !10                         # runs: ps w
  PID TTY      STAT   TIME COMMAND
12174 pts/3    Ss     0:00 bash
21553 pts/8    S+     0:00 ./cs31shell
21717 pts/8    R+     0:00 ps w

cs31shell> history
     6  ps w
     7  ./sleeper 20 &
     8  ps w
     9  blah
    10  ps w
    11  history
    12  ./sleeper &               # this was added from !4
    13  ps w                          # this was added from !10
    14  ps w                          # this was added from !10
    15  history

cs31shell> !3
!3: not found

cs31shell> !12                         # runs: ./sleeper &

cs31shell> !13                         # runs: ps w
  PID TTY      STAT   TIME COMMAND
12174 pts/3    Ss     0:00 bash
21553 pts/8    S+     0:00 ./cs31shell
21748 pts/8    S+     0:00 ./sleeper
21758 pts/8    R+     0:00 ps w

cs31shell> history
     9  blah
    10  ps w
    11  history
    12  ./sleeper &
    13  ps w
    14  ps w
    15  history
    16  ./sleeper &
    17  ps w
    18  history

cs31shell> ps w
  PID TTY      STAT   TIME COMMAND
12174 pts/3    Ss     0:00 bash
21553 pts/8    S+     0:00 ./cs31shell
21748 pts/8    S+     0:00 ./sleeper
21768 pts/8    R+     0:00 ps w

cs31shell> exit
bye bye