-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathman_1_simple_shell
More file actions
114 lines (93 loc) · 2.8 KB
/
man_1_simple_shell
File metadata and controls
114 lines (93 loc) · 2.8 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
./" Manpage for simple_shell
.TH man 1 "18 November 2019" "1.0" "simple_shell man page"
.SH NAME
.B simple_shell
- simple UNIX command interpreter.
.SH SYNOPSIS
.B ./hsh
.SH DESCRIPTION
.B simple_shell
is a UNIX command line interpreter that display a prompt and wait for the user
to type a command. A command line always ends with a new line. The prompt
isdisplayed again each time a command has been executed. Use the PATH, and
handle commands with arguments.
The current version of simple_shell is in the process of being changed to
conform with the Holberton School specifications for the shell. This version
has many features which make it appear similar in some respects to the SH
shell, but it is not a SH shell clone (see sh(1)). Only features designated
by Holberton School, plus a few additional extensions, are being incorporated
into this simple_shell. This man page is not intended to be a tutorial or
a complete specification of the simple_shell.
Overview
The
.B simple_shell
is a command that reads lines from either a file or the terminal,
interprets them, and generally executes other commands. It is a program
that can run when a user execute it into the system. The simple_shell was
implemented in C language and provides a variety of 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 simple_shell or can
be put into a file and the file can be executed directly by the simple_shell.
.SH ARGUMENTS
An interactive shell is started without non-option arguments. After that
the first arguments from input is assumed to be an executable file
followed by parameters accepted by that command.
.SH INTERACTIVE MODE EXAMPLE
.PP
.PP
$ ./hsh
.PP
$ /bin/ls
.PP
hsh main.c shell.c
.PP
$ exit
.PP
$
.PP
.PP
.SH NON-INTERACTIVE MODE EXAMPLE
.PP
.PP
$ echo "/bin/ls" | ./hsh
.PP
.PP
hsh main.c shell.c test_ls_2
.SH VARIABLES
Add the
.B $
to a variable name expands to the value of the variable
.PP
.RS
.B $?
expands to the return value of the last command executed
.SH BUILTIN COMMANDS
Commands called and handled directly in the simple shell and thus do not need
to call upon a child process to be executed.
.PP
.B exit
.PP
- terminates the shell returning a exit status of the previous command attempted
to be executed
.PP
.PP
.B env
.PP
- prints the enviromental variables and their values in the notation "name=value"
.PP
.PP
.SH COMMENTS
A word beginning with # causes that word and all remaining characters on that
line to be ignored.
.SH OPTIONS
.B simple_shell
does not take any options
.SH SEE ALSO
.I sh(1), ksh(1), bash(2).
.SH BUGS
No known bugs.
.SH AUTHOR
Oscar Gomez T. (https://github.com/OscarGomez87)
.PP
Leonardo Calderon J. (https://github.com/leocjj)