-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathman_1_simple_shell
More file actions
89 lines (77 loc) · 2.21 KB
/
Copy pathman_1_simple_shell
File metadata and controls
89 lines (77 loc) · 2.21 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
.TH BA_SHELL 1 "August 25 2021" "HOLBERTON SCHOOL CH14"
.SH NAME
BAShell.
- BAShell is a simple shell that can be compiled and executed from the command line.
.SH SYNOPSIS
.B ./BAShell
.SH DESCRIPTION
.B BAShell is a simple command line interpreter, that ptovides a command liner user interface meaning thtat it reads lines from either file or terminal (standart input), interprets them, and executes commands. The firs Unix shell was the Thompson shell, sh , written by Ken Thompson. Simple_check will chech if the fisrts argument passed to it , is a built-in (ls, cd, pwd, etc). If it fails, it will check wheter is a bulit-in script, if not then it will check tha PATH for the executable file. And only when it finds it, will execute the command.
.SH OVERVIEW
simple_shell interprets and executes command that the same simple_shell reads from the standard input or files.
.SH INVOCATION
First compile BAShell with the exery \".c\" file in your current directory, using the specified
flags. Use the wildcard '*' to get all your \".c\" files.
.P
.RS
.IP -Compilling
.B gcc -Wall -Werror -Wextra -pedantic *.c -o BAShell
.P
.RE
BAShell can run in interactive mode by typing "./BAShell" on the command line, and then hit "Enter".
prompt "$ " appears you are in interactive mode, meaning you can type your commands followed by "Enter". Type:
.P
.RS
.B ./BAShell
.P
.RE
.IP -Non-Interactive-mode.
Also, simple_shell works in non-interactive mode with shell scripts.
.P
.RS
.B echo 'pwd' | ./BAShell
.P
.SH EXAMPLES
A few of the commands that can be executed in the simple_shell, included in the PATH environment variable:
.P
.B ls
.P
--- List files and directories
.P
.B pwd
.P
--- Prints current working directory
.P
.B mkdir
.P
--- Creates directory
.P
.SH BUILTINS
Here, we list the built-in commands from the BAShell program. They are buit-in for efficiecy.
.P
.B cd
.P
--- Switch to HOME directory.
.P
.B cd ..
.P
--- Moves up one directory.
.P
.B cd [directory]
.P
--- Switch to specified directory.
.P
.B exit
.P
--- Terminate the shell process.
.P
.B env
.P
--- Prints all environment variables.
.P
.SH SEE ALSO
sh(1) man page.
.SH AUTHORS
.B Firdaus H. Salim
.B <firdaushassan033@gmail.com>
.B Aaron Kaddu Muzira
.B <aaronmuzira@gmail.com>