-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathman_1_simple_shell
More file actions
executable file
·148 lines (99 loc) · 2.91 KB
/
man_1_simple_shell
File metadata and controls
executable file
·148 lines (99 loc) · 2.91 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
.\" arsine man page
.\"
.\"
.TH ARSINE 1 "09 March 1847" "0.1" "arsine"
.SH NAME
.B arsine (hsh)
- command interpreter (shell)
.SH SYNOPSIS
.B ./hsh
.SH COPYRIGHT
arsine is Public Domain, no copyright protection
.SH DESCRIPTION
arsine replicates a command line interpreter (a shell), which is a user \
interface program for access to an operating system's services. This shell \
is designed to interact with a linux distribution or unix like system that \
uses linux system calls and other commands found in the linux PATH, for \
example, the
.B $PATH:
.P
.RS
.B /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
.P
.RE
arsine has a set of custom built-in commands, and also integrates with other \
commands located in the system's PATH. The output is designed to exactly or \
as close as possible replicate the shell 'sh' or 'dash'
.B $ man dash
. arsine \
takes commands from files, shell scripts or user input in either an \
interactive or non-interactive mode (explained in INVOCATION section).
.SH INVOCATION
to initialize arsine, you must compile all the included files using the GNU \
compiler collection: gcc. Then run the output file, with a command such as \
this: $ ./a.out. arsine has been written to pass all of these warning checks \
and was designed to be compiled with the following command:
.P
.RS
.B $ gcc -Wall -Werror -Wextra -pedantic *.c -o hsh
.P
.RE
if arsine is exectured, it will initialize in what is considered 'interactive \
mode.' In this scenario, the user is prompted for a command and then the \
command is executed after the newline or 'enter' is input. arsine can also \
function in non-interactive mode by using shell scripts, such as a '|' before
the arsine executable file ('hsh'). This is an example:
.P
.RS
.B $ echo 'ls' | ./hsh
.P
.RE
Commands may also be input into arsine through a file containing commands:
.P
.RS
.B $ cat aFile | ./hsh
.P
.RE
.SH OPTIONS
arsine does not take any options but does utilize the variable extern char \
**environ. This is currently part of the future goals of arsine
.SS BUILT-IN COMMANDS
.RS
This secion has information on the included builtin commands with arsine
.Bl -tag -width "PAGEIN" -compact -offset indent
.It
.B env
- writes environment to stdout
.IT
.B setenv
- sets or changes an environmental variable. example: 'setenv USER=bobby'
.IT
.B unsetenv
- removes environmental variable. example: 'unsetenv USER'
.IT
.B history
- writes history to stdout
.IT
.B exit
- exits arsine
.IT
.B cd
- changes working directory
.IT
.B help
- used with another command prints help message. example: 'help env'
.IT
.B alias
- creates an alias. example 'alias ll='ls -la''
.IT
.B unalias
- removes an alias. example 'unalias ll'
.RE
.SH "SEE ALSO"
.BR sh (1),
.BR bash (1),
.SH BUGS
none known. arsine does not currently replicate these tasks:
.SH AUTHOR
Bobby Yang <122@holberton.com>
David John Coleman II <lcsw@davidjohncoleman.com>