-
Notifications
You must be signed in to change notification settings - Fork 6
/
man_simple_shell
85 lines (59 loc) · 2.81 KB
/
man_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
74
75
76
77
78
79
80
81
82
83
84
85
.TH HSH 1 "27 Nov 2019" "0.1" "HSH"
.SH NAME
.B hsh
- command interpreter (simple shell)
.SH SYNOPSIS
.B ./hsh
.SH DESCRIPTION
The hsh shell is a command-line interpreter that provides a command line user interface for Unix-like operating systems.
The shell is both an interactive command language and a scripting language, and is used by the operating system to control the
execution of the system using shell scripts.
.B Overview
The shell is a command that reads lines from either a file or
the terminal, 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 constructs, a macro
facility that provides a variety of features in addition to data storage,
along with built in history and line editing capabilities. It
incorporates many features to aid interactive use and has the advantage
that the interpretative language is common to both interactive and non-
interactive use (shell scripts). That is, 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.
.B Interactive mode
The commands are run with user-interaction from keyboard.
E.g. the shell can prompt the user to enter input.
.B Non-interactive mode
The shell is probably run from an automated process so it can't assume if can request input or that someone will see the output.
E.g Maybe it is best to write output to a log-file.
.B Builtins
This section lists the builtin commands which are builtin because they
need to perform some operation that can't be performed by a separate
process. In addition to these, there are several other commands that
may be builtin for efficiency (e.g. printf(1), echo(1), test(1), etc).
.SH EXAMPLE
($) ./hsh
($) ls
README.md _print_env.c frees.c remove_new_line.c utilities.c
_exit.c builtin_commands.c main.c shell.h
_getenv.c counters.c man_simple_shell signal_handler.c
_open_help.c exec.c more_utilities.c tokenize.c
($)
.SH EXIT STATUS
Errors that are detected by the shell, such as a syntax error, will
cause the shell to exit with a non-zero exit status. If the shell is
not an interactive shell, the execution of the shell file will be
aborted. Otherwise the shell will return the exit status of the last
command executed, or if the exit builtin is used with a numeric
argument, it will return the argument.
.SH ENVIRONMENT
.B PATH
The default search path for executables.
.B PWD
The logical value of the current working directory. This is set by the cd command.
.SH SEE ALSO
.I dash(1), echo(1), getopt(1), ksh(1), login(1), printf(1), test(1), getopt(3), passwd(5), environ(7), sysctl(8)
.SH BUGS
No known bugs.
.SH AUTHOR
Andrea Mendez Mesias (1159@holbertonschool.com), Marlon Santiago Arboleda (monoprosito@gmail.com)