Repository navigation
Expand file tree
/
Copy pathman_1_simple_shell
More file actions
executable file
·91 lines (68 loc) · 2.4 KB
/
Copy pathman_1_simple_shell
File metadata and controls
executable file
·91 lines (68 loc) · 2.4 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
.TH Ghost 1 "20 April 2017" "version 1.0" "Programmer's Manual"
.SH NAME
.B Ghost Shell (hsh)
- command interpreter (shell)
.SH SYNOPSIS
.PP
.B ./hsh
.PP
.B
.SH DESCRIPTION
The ghost shell is a command that reads lines from either a file or the termi- \
nal, interprets them, and generally executes other commands. It is the \
program that is running when a user logs into the system. The shell implements a language \
that has flow control contructs, a macro facility that provides a variety of features in addition to data \storage, along withe built in history and line editing capabilities. It also has features to \
aid interactive use and has the advantage that the interpretative language is common to both interactive\ and non-interactive use (shell scripts). Commands can be typed directly to the running shell or can be put\ into a file and the file can be executed directly by the shell.
.PP
.SH EXAMPLE:
$PATH:
.PP
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
.PP
Ghost shell has two builtinin commands it also integrates with other commands \
that can be located in the PATH. The output of ghost shell is to replicate \
exactly as the shell 'sh' or 'bash'.
.PP
.B $ man bash
. Ghost Shell\
The ghost shell takes commands from files, shell scripts and user input in both interactive or non-interactive mode.
.SH INITIALIZATION
To use the ghost shell the user needs to compile \
using: gcc. The run the output file by calling it whether \
by the output name it was given.
.PP
.B EX: $ ./some_name or $ a./a.out.\
.PP
.SH The ghost shell will compile with the following:
gcc -Wall -Wextra -Werror -pedantic *.c -o hsh
.PP
If the user inputs piplines or calls non-interactive mode the ghost shell should\
funciton and execute said commands. An example of non-interactive mode input:
.PP
.B $ echo 'ls -a' | ./hsh
.PP
.PP
.RE
.SH Another example of non interactive mode:
.PP
.B $ cat some_file | ./hsh
.PP
.SH OPTIONS
The ghost shell does not take any options but does utilize \
extern char **environ.
.B
.PP
.SH BUILT-INS
.PP
.B There are two builtins in the shell.\
.PP
env - tells the program to display all of the environment variables with thier values. \
Also a way to access the values through the shell.
.PP
exit - To exit out of the shell user can utilize exit. Exits program with status 0.\
.SH SEE ALSO
.I Nothing else
.SH BUGS
No Known Bugs
.SH AUTHORS
.B Carrie Ybay and Wendy Segura