Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Directions for Use

Simply type "make desh" to get an executable desh to run the shell. When you get desh type "./desh" to run the shell. On the shell you can put in the builtin commands:

  • exit: Exit the shell. It should accept an optional numerical argument as the exit code for the shell. If the argument is non-numeric, exit 0.
  • which: same as the Bash one: finds the first matching command for each argument
  • list: with no arguments, lists the files in the current working directory one per line. With arguments, lists the files in each directory given as an argument, with a blank line then the name of the directory followed by a : before the list of files in that directory.
  • pwd: print the current working directory.
  • cd: chdir(2) to directory given. With no arguments, change directory to the home directory. With a '-' as the only argument, change to the previous directory (same as Bash does).
  • pid: prints the pid of the shell
  • prompt: When run with no arguments, prompts for a new prompt prefix string. When given an argument make that the new prompt prefix.
  • printenv: Works similarly to the Bash command. With no arguments, prints the whole environment. Otherwise, print the environment variable values for each argument in the form "VAR=VALUE" (or "No variable: VAR", if there is no environment variable with the given name).
  • setenv: With no arguments, prints the whole environment, the same as printenv. When run with one argument, sets it as an empty environment variable. With two arguments, the second one is the value of the first. With more args, print an error message to stderr. You can use the setenv(3) function for this command. If PATH is changed, be sure to update your linked list for the path directories (and free() up the old one). When HOME is changed, cd with no arguments should go to the new home.

About

Simple desh shell I made in my operating systems class to better learn how to use fork and exec. Exits with the exit command, and ignores ctrl + C and ctrl + D. Utilizes global characters like ? and *. Instructions on how to use the shell are given in the README.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages