forked from wendysegura/simple_shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
man_1_simple_shell
105 lines (95 loc) · 3.01 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
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
.TH Turtle 1 "20 July 2017" "version 1.0" "Programmer's Manual"
.SH NAME
.B Turtle Shell (hsh)
- command interpreter (shell)
.SH SYNOPSIS
.PP
.B hsh [options] [file]
.SH COPYRIGHT
.PP
.B hsh is Copyright (C) 2017-2017 by the Holberton Student Foundation, Inc.
.PP
.B
.SH DESCRIPTION
The turtle 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 contructs, a macro facility that provides a variety of features in addition to data \storage, along withe built in history and line editing capabilities. It also has features to \
aid interactive use and has the advantage that the interpretative language is common to both interactive\ and non-interactive use (shell scripts). 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.
.PP
.SH EXAMPLE:
$PATH:
.PP
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
.PP
Turtle shell has two builtinin commands it also integrates with other commands \
that can be located in the PATH. The output of turtle shell is to replicate \
exactly as the shell 'sh'.
.PP
.B $ man sh
. Turtle Shell\
The turtle shell takes commands from files, shell scripts and user input in both interactive or non-interactive mode.
.SH OPTIONS
.PP
.B Turtle shell does not take any options from command line
.SH INITIALIZATION
To use the turtle shell the user needs to compile \
using: gcc. The run the output file by calling it whether \
by the output name it was given.
.PP
.B EX: $ ./some_name or $ a./a.out.
.PP
The turtle shell will compile with the following:
.PP
.B gcc -Wall -Wextra -Werror -pedantic *.c -o hsh
.PP
.SH PIPELINES
Pipeline is a sequence of one or more commands separated by the character |.
.PP
Turtle shell accepts input piped in when executed from command line, however turtle shell does not parse pipes internally.
If the user inputs pipes in non-interactive mode the ghost shell should\
function and execute said commands.
.PP
An example of non-interactive mode input:
.PP
.B $ echo 'ls -a' | ./hsh
.PP
.PP
Another example of non interactive mode:
.PP
.B $ cat some_file | ./hsh
.PP
.SH OPTIONS
The turtle shell does not take any options but does utilize \
extern char **environ.
.B
.PP
.SH BUILT-INS
.PP
There are two builtins in the shell.
.PP
.B env -
.PP
Tells the program to display all of the environment variables with thier values. \
Also a way to access the values through the shell.
.PP
.B exit -
.PP
To exit out of the shell user can utilize exit. Exits program with status 0.
.PP
.SH SEE ALSO
.I Nothing else
.SH BUGS
Disclosure this program takes no more than 1024,
using more than alloted 1024 will cause segmentation fault or unpredictable behavior.
.PP
The following variables take a buffersize of 1024:
.PP
.B PATH_TOKENS
.PP
.B CMD_TOKENS
.PP
.B FULL_PATH
.PP
.SH AUTHORS
.B Wendy Segura and Larry Madeo