-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathman_1_simple_shell
69 lines (49 loc) · 2.09 KB
/
man_1_simple_shell
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
.TH HSH 1 "10 Oct 2021" "1.0"
.SH NAME
.B Holberton Shell
- a simple command line interpreter based on sh
.SH SYNOPSIS
.B hsh\fR [\fIfilename\fR]
.SH DESCRIPTION
.B hsh\fR is a UNIX based simple command line interpreter that executes commands read from the standard input or from a file.
.P
.B hsh\fR can be used in both an interactive and a non interactive mode. In \fInon\fR-\fIinteractive\fR mode, \fBhsh\fR is invoked using standard input not connected to a terminal, then reads and executes commands.
In \fIinteractive\fR mode, \fBhsh\fR is invoked with standard input connected to a terminal.
A \fI$\fR is displayed when in \fIinteractive\fR mode to prompt the user to enter commands to the standard input, with or without arguments, in a similar way to \fBsh\fR.
.PP
.B hsh\fR checks whether the command entered contains a "/" or a "."
If it does, the command and arguments are executed.
If it doesn't, \fBhsh\fR checks whether the command exists in one of the directories as specified by the environment variable \fIPATH\fR. If the command is found, the arguments passed to the command are processed and the command executed normally.
Otherwise, an error message is displayed to the standard error.
.SH Built-In Commands
.B exit
.RS
Usage: [\fBexit\fR]
Exits the \fBhsh\fR.
.B hsh\fR does not handle exit function arguments yet.
.RE
.B env
.RS
Usage: [\fBenv\fR]
Prints the current environment.
.RE
.B cd
.RS
Usage: \fBcd\fR [\fIdirectory\fR].
Changes the current directory of the process.
If no argument is given to \fBcd\fR the command is interpreted like \fBcd $HOME\fR.
.RE
.B help
.RS
Usage: \fBhelp\fR [built-in]
Displays information about \fBhsh\fR built-in commands.
The kill process command \fICtrl+C\fR has been disabled.
.SH BUGS
.B hsh\fR currently has no known bugs. Any bug reports should be made to the authors of the program. See \fBAUTHORS\fR below.
.SH AUTHORS
Washington Obungu
<\[email protected]\fR>
Joseph Emmanuel
<\[email protected]\fR>
.SH SEE ALSO
B. sh(1), chdir(2), execve(2), fork(2), free(2), getline(3), isatty(3), malloc(3), perror(3), signal(2), stat(2), wait(2), write(2).