-
Notifications
You must be signed in to change notification settings - Fork 0
/
man_1_simple_shell
85 lines (85 loc) · 1.93 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
.\" Man page for hsh
.TH HSH 1 "28 August 2019" "Holberton" "Holberton Shell Man Page"
.SH NAME
.B hsh
\- a simple command interpreter
.SH SYNOPSIS
.B hsh
.RI [ FILENAME ]
.SH DESCRIPTION
hsh executes commands read from standard input or from a file. Lines are read
one at a time. Each line is first split into tokens and dequoted. The first
word is then checked for aliases. If an alias is found, it is expanded. The
first word of the resulting command is checked to see if it is a builtin. If
it is, then hsh executes the builtin before reading the next line of input.
If it is not a builtin, a path search is performed. If the command is not
found, the status is set to 127. If the command is found but not executable,
the status is set to 126. Otherwise, hsh forks and executes the given command
before reading the next line of input.
mimic the behavior of other POSIX-compliant shells (e.g. dash)
.SS BUILTINS
.TP
.B alias
.RI [ NAME [=' VALUE ']
.R ...]
Print and define command aliases.
.TP
.B cd
.RI [ DIRECTORY ]
Change the current working directory.
.TP
.B env
Print the environment.
.TP
.B exit
.RI [ STATUS ]
.Exit the shell.
.TP
.B help
.R [
.I BUILTIN
.R ...]
Show a help message.
.TP
.B setenv
.I VARIABLE VALUE
Set an environment variable.
.TP
.B unsetenv
.I VARIABLE
.R ...
Unset an environment variable.
.SH EXIT STATUS
If the exit builtin is called with a status,
.B hsh
.R exits with the specified value. Otherwise,
.B hsh
.R exits with the exit status of the previous command.
.SH ENVIRONMENT
.TP
PATH
The default search path for executables
.TP
HOME
The default argument for the cd builtin
.TP
PWD
Set by the cd builtin upon changing directories
.TP
OLDPWD
Set by the cd builtin and used as it's argument it receives ``-''
.SH EXAMPLES
.PP
hsh
.PP
echo ls | hsh
.SH SEE ALSO
.BR sh(1) , bash(1) , csh(1) , dash(1)
.SH BUGS
No known bugs.
Report bugs to ...
.SH AUTHORS
.PP
Banu Sapakova (banuaksom@gmail.com)
.PP
Patrick DeYoreo (pdeyoreo@gmail.com)