-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathman_1_simple_shell
73 lines (61 loc) · 1.46 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
70
71
72
73
.TH HSH 1 "April 2021" "Holberton School"
.P
.SH NAME
.B hsh \- simple UNIX command interpreter (shell).
.SH SYNOPSIS
.B Execute the shell: ./hsh
.SH DESCRIPTION
.B hsh is a simple UNIX command interpreter that reads commands from standard input and executes them, simulating the behavior of the sh (/bin/sh) command interpreter (shell).
Features:
.RS
.nf
- Handles simple commands.
- Handles the PATH.
- Handles command lines with arguments.
- Handles the Ctrl + D condition (end-of-file) to exit the program.
- Handles the Ctrl + C signal to not kill the program.
- Handles comments (#).
- Handles errors.
.RE
Built-in commands:
.RS
.nf
- Handles help buit-in command that prints information about builtin commands.
- Handles exit buit-in command that exits the shell.
- Handles env buit-in command that prints the current environment.
.RE
.SH EXAMPLES
.B
hsh should work like this in interactive mode:
.in +3n
.nf
$ ./hsh
hsh> /bin/ls
README.md main.c shell.h
hsh>
hsh> exit
$
.in
.B
hsh should work like this in non-interactive mode:
.in +3n
.nf
$ echo "/bin/ls" | ./hsh
README.md main.c shell.h
$ echo "pwd" | ./hsh
/root
$
.in
.SH BUGS
The following features presents issues:
.RS
.nf
- Handles the PATH.
- Handles errors.
- Handles exit buit-in.
- Handles env buit-in.
.RE
.SH SEE ALSO
execve(2), fork(2), free(3), getline(3), getpid(2), isatty(3), malloc(3), perror(3), sh(1), signal(2), stat(2), strtok(3), wait(2), write(2).
.SH AUTHOR
Maximiliano Pan and Alina De Los Santos