-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
35 lines (28 loc) · 1.87 KB
/
README
File metadata and controls
35 lines (28 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
The Pipe Shell
By Elijah Montgomery
The P shell
This program implements a very simple UNIX shell in C using Flex and Bison. Originally, this was created for CS485G Systems Programming with Professor Griffioen at University of Kentucky. I have since modified it slightly and plan to do more work on it in the future. Also, I believe it serves as a good example of how one can implement a simple shell or other programs in C with Flex and Bison.
Included files are:
- psh.y: Input parser implemented with GNU bison. Note that this also includes the functions to execute the parsed input
- psh.l: Input lexical analyzer implemented with flex
- psh.h: Pipe shell header file. Defines the node type used by the bison parser as well as a few other things needed by the shell
- varlist.c: Symbol table implemented using a singly-linked list in C
- varlist.h: Header file for symbol table. Defines node type used by symbol table and a few other things needed by the symbol table.
- Makefile: Makefile to build the entire project
- README: information about the program
To compile:
- Type "make" from the root directory of the project
To delete compilation files:
- Type "make clean" from the root directory of the project
Features:
- Includes all builtin commands listed in the project spec
- Uses path to execute command, so ls can be executed with "ls" or "/bin/ls"
- Checks errno's value after system calls to create more informative error messages
Limitations:
- Cannot currently execute builtin commands using a variable as the command name. For example:
setvar $mycmd echocmd
$mycmd on
would attempt to execute echocmd as a system command
- Prompt cannot be a dynamic prompt like many shells support. It must be a static string
and is only changed when the user explicitly changes it.
- Cannot use complex variable substitution like having $myvar.txt substitute in the value of myvar