-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathman_1_hsh
executable file
·92 lines (73 loc) · 3.98 KB
/
man_1_hsh
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
.\" Manpage for hsh.
.\" Contact sravanthi.sinha@holbertonschool.com to correct errors or typos.
.TH hsh 1 "17 August 2017" "hsh(1)" "General Commands Manual"
.SH NAME
hsh \- command line interpreter (holberton shell)
.SH SYNOPSIS
hsh
.SH DESCRIPTION
hsh is a a UNIX command line interpreter.
.TP
.BI Overview
The shell is a command that reads lines from either a file or the terminal, interprets them, and generally executes other commands.
.TP
.BI Redirections
Redirections are used to change where a command reads its input or sends its output. In general, redirections open, close, or duplicate an
existing reference to a file. The overall format used for redirection is:
.RS
[command] redir-op file
where redir-op is one of the redirection operators mentioned previously. Following is a list of the possible redirections.
[command]> file Redirect standard output to file.
[command]>> file Append standard output to file.
[command]< file Redirect standard input from file.
The following redirection is often called a “here-document”.
[command]<< delimiter
here-doc-text ...
delimiter
.RE
.TP
.BI Command Exit Status
Each command has an exit status that can influence the behaviour of other shell commands. The paradigm is that a command exits with zero for
normal or success, and non-zero for failure, error, or a false indication. The man page for each command should indicate the various exit
codes and what they mean. Additionally, the builtin commands return exit codes, as does an executed shell function.
If a command consists entirely of variable assignments then the exit status of the command is that of the last command substitution if any,
otherwise 0.
.TP
.BI Pipelines
A pipeline is a sequence of one or more commands separated by the control operator |. The standard output of all but the last command is
connected to the standard input of the next command. The standard output of the last command is inherited from the shell, as usual.
The format for a pipeline is:
command1 [| command2 ...]
The standard output of command1 is connected to the standard input of command2. The standard input, standard output, or both of a command is
considered to be assigned by the pipeline before any redirection specified by redirection operators that are part of the command.
A ; or ⟨newline⟩ terminator causes the preceding AND-OR-list (described next) to be executed sequentially; a & causes asynchronous execution
of the preceding AND-OR-list.
Note that unlike some other shells, each process in the pipeline is a child of the invoking shell (unless it is a shell builtin, in which
case it executes in the current shell -- but any effect it has on the environment is wiped).
.TP
.BI Builtins
.RS
This section lists the builtin commands which are builtin because they need to perform some operation that can't be performed by a separate
process. In addition to these, there are several other commands that may be builtin for efficiency (e.g. printf(1), echo(1), test(1), etc).
.TP
cd -
.TP
cd [directory]
Switch to the specified directory (default HOME). If an entry for CDPATH appears in the environment of the cd command or the shell
variable CDPATH is set and the directory name does not begin with a slash, then the directories listed in CDPATH will be searched for
the specified directory. The format of CDPATH is the same as that of PATH. If a single dash is specified as the argument, it will be
replaced by the value of OLDPWD. The cd command will print out the name of the directory that it actually switched to if this is dif
ferent from the name that the user gave. These may be different either because the CDPATH mechanism was used or because the argument
is a single dash.
.TP
exit [exitstatus]
Terminate the shell process. If exitstatus is given it is used as the exit status of the shell; otherwise the exit status of the preceding command is used.
.TP
env
Prints the current environment
.SH SEE ALSO
hsh(1)
.SH BUGS
No known bugs.
.SH AUTHOR
Sravanthi Sinha (sravanthi.sinha@holbertonschool.com)