forked from kevin-gatimu/simple_shell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathman_1_simple_shell
More file actions
129 lines (102 loc) · 2.49 KB
/
man_1_simple_shell
File metadata and controls
129 lines (102 loc) · 2.49 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
.TH hsh 1 "AUGUST 14, 2021" "1.0" "hsh (simple_shell) Man Page"
.SH NAME
.B simple_shell - hsh
- command line interpreter or shell
.SH SYNOPSIS
.B ./hsh
.I (no options included as of this writing (August 14, 2021))
.SH DESCRIPTION
simple_shell, is a custom implementation of a simple UNIX shell. A minimalistic approach was taken in its design and implementation to only provide the basic functions of a shell similar to the one designed by the pioneer of UNIX shells, Ken Thompson. Design, compilation, and testing was done on Ubuntu 20.04 LTS.
.SH OVERVIEW
Similar to other legendary command line interfaces, the simple_shell takes input from either the terminal or scripts and executes them as they appear.
.SH INVOCATION
The GNU Compiler Collectiojn, gcc, is recommended for compiling simple_shell with extra flags as shown.
.P
.RS
.B $ gcc -Wall -Werror -Wextra -pedantic *.c -o hsh
.P
.RE
In interactive mode, the simple_shell works by taking user input on the terminal after pressing the enter key. Note that the prompt ('$') will appear and you will then be in interactive mode and able to enter commands followed by "enter."
.P
.RS
.B $ ./hsh
.P
.RE
In non-interactive mode, users can specify shell scripts to be executed by simple_shell usually through the use of pipes '|'.
.P
.RS
.B echo 'pwd' | ./hsh
.SH EXECUTABLES
Example of executables:
.IP
.br
.\&
.RS
\&$ echo "Example of executables"
.br
\&"Example of executables"
.br
\&$
.SH BUILTINS
The following builtin commands are supported:
.IT
.B env
- prints the environment variables
.B exit
- exits the program
.B setenv
- sets the environment
.B unsetenv
- removes elements from the environment
Example of builtin command:
.IP
.br
.\&
.RS
\&$ env
.br
\&TERM=xterm-256color
.br
\&SHELL=/bin/bash
.br
\&SSH_CLIENT=10.0.2.2 50046 22
.br
\&OLDPWD=/home/vagrant
.br
\&SSH_TTY=/dev/pts/0
.br
\&LC_ALL=en_US
.br
\&USER=vagrant
.br
\&MAIL=/var/mail/vagrant
.br
\&PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
.br
\&PWD=/home/vagrant/simple_shell
.br
\&LANG=en_US.UTF-8
.br
\&SHLVL=1
.br
\&HOME=/home/vagrant
.br
\&LOGNAME=vagrant
.br
\&SSH_CONNECTION=10.0.2.2 50046 10.0.2.15 22
.br
\&LESSOPEN=| /usr/bin/lesspipe %s
.br
\&LESSCLOSE=/usr/bin/lesspipe %s %s
br.
\&_=./hsh
.br
\&$
.SH BUGS
No known bugs have been found/reported as of (August 14, 2021).
Please report any issues/bugs to the contributors listed in the AUTHORs section.
.SH AUTHOR
Mark Agugo <markagugo@gmail.com>
Mbali Sithole <missmbalisithole@gmail.com>
.SH SEE ALSO
sh