-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathman_1_simple_shell
More file actions
158 lines (135 loc) · 2.54 KB
/
man_1_simple_shell
File metadata and controls
158 lines (135 loc) · 2.54 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
.TH man 1 "14 April 2020" "" "1.0 simple_shell man page"
.SH NAME
.B simple_shell
- Simple Shell for Holberton School
.SH SYNOPSIS
.B ./hsh
[command] [options]
.SH DESCRIPTION
The simple shell (hsh) it's a simple program that contains and executes the basic functions of a shell (bash).This shell, like the others, takes keyboard commands and delivers them to the system to be executed. Whit this shell you can execute commands like ls for example.
.br
Shell is a program that takes commands from the keyboard and gives them to the operating system to perform.
.B Overview
This simple shell is a simplification of a command interpreter, similar to
.B bash.
.TP
Command [option]... ls -la
.SH OPTIONS
Simple Shell
operates in both
.I interactive
and
.I non-interactive
mode. The user may initiate
.B simple shell
and begin working or initate
.B simple shell
using commands meant to be run by the program.
.SH ARGUMENTS
The first argument, argument 0 is understood to be the command to be run by
.B simple shell
and arguments following as modifier or options.
.B Return value
The return value of a simple command is its exit status. returns various values depending on the success of the program execution or if an error occurred.
.B Example
.PP
$./hsh
$ touch Hello.txt
$ ls
.RS 3
firts.txt
.TB
Hello.txt
.TB
second.txt
.RE
$ |
.RS +4
[$ ./hsh
.RE
.RS +4
[$ /bin/ls
.RE
.RS +4
hsh firts.txt hello.tx second.txt
.RE
.RS +4
$
.RE
.RS +4
[$ exit
.RE
.RS +4
$
.RE
.B Run pwd command:
.RS +4
[$ pwd
.RE
.RS +4
/home/vagrant/simple_shell
.RE
.RE
.B Run exit command:
.RS +4
[$ exit
.RE
.RS +4
vagrant@vagrant-ubuntu-trusty-64:~/simple_shell$
.RE
.B Non-interactive mode:
.RS +4
$ echo "/bin/ls" | ./hsh
.RE
.RS +4
firts.txt hello.txt second.txt test_ls_2
.RE
.RS +4
$
.RE
.RS +4
$ cat test_ls_2
.RE
.RS +4
/bin/ls
.RE
.RS +4
/bin/ls
.RE
.RS +4
$
.RE
.RS +4
$ cat test_ls_2 | ./hsh
.RE
.RS +4
hsh main.c shell.c test_ls_2
.RE
.RS +4
hsh main.c shell.c test_ls_2
.RE
.RS +4
$
.PP
.SH RESERVED WORDS
.B exit:
quits the program, exit the shell.
.B env:
displays a list of environment variables
.B help:
built-in which displays the help information for the included built-in.
.SH RESERVED KEY-WORDS
.B ctrl + D:
quits the program, exit the shell, similar to command exit.
.B ctrl + C:
ends the process that is running, useful to regain control of the system.
.SH SEE ALSO
.I sh(1)
,
.I bash(1)
.SH BUGS
Not found at the moment in the implemented functionalities, if you find any inform us.
.SH AUTHORS
Dairo Facundo Duarte <dairof7@gmail.com>
.br
Oscar Eduardo Info <racso1607@gmail.com>