Repository navigation
Expand file tree
/
Copy pathhome.html
More file actions
220 lines (161 loc) · 5.64 KB
/
Copy pathhome.html
File metadata and controls
220 lines (161 loc) · 5.64 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Advanced Bash-Scripting Guide</title>
<style>
body {
max-width: 1000px;
margin-left: auto;
margin-right: auto;
padding-bottom: 5em;
font-family: serif;
line-height: 1.6
}
h1, h2, h3 {
color: darkgray;
font-family: sans-serif;
}
h2 {
border-bottom: 1px dotted gray;
padding-top: 1em;
}
pre {
background-color: #f7f7f8;
line-height: 1.45;
padding: 10px;
}
code {
background-color: #f7f7f8;
}
</style>
</head>
<body>
<h1 style='text-align: center;'>Advanced Bash-Scripting Guide</h1>
<h2>About</h2>
<p>(TODO: A more sophisticated introductional paragraph
here)</p>
<p>The <i>Advanced Bash-Scripting Guide</i> is a book written by
<b>Mendel Cooper</b> and part of The Linux Documentation Project, page
<a href='https://www.tldp.org/guides.html'>Guides</a>. <b>This is a
fork</b> of the original work which itself had been (since 2014)
dedicated to the <b>Public Domain</b>.</p>
<h2>Web</h2>
<p>To read in a <b>browser</b>, follow the link <a
href='../bash-scripting-guide'>Advanced Bash-Scripting Guide</a><p>
<p>For <b>off-line viewing</b> download and unpack: <span
style='color: gray; cursor: pointer;' title='Not ready
yet'>bash-scripting-guide.zip</span> (TODO)</p>
<h3>Web fonts</h3>
<p>The HTML styling sets <code>font-family:
serif/sans-serif/monospace</code> <b>without</b> any specific <b>font
names</b>, <code>font-size:</code> is set in units of <i>em</i>, the
main size is <i>1 em</i>.<p>
<p>This approach respects the font name and font size <b>settings of
the browser</b>, it adapts across monitor sizes and pixel resolutions.</p>
<h2>GNU Info format</h2>
<h3>Viewer</h3>
<p><b>What</b> is GNU Info?</p>
<p>GNU Info is a help viewer that operates in a <b>hypertext
format</b> for easy navigation of multi-page documentation. It is
useful in the conditions of a terminal session.</p>
<p><b>Example</b> page from the book displayed in Info:</p>
<pre style='background: linen; font-size: 80%;'>
Next: Special Characters, Prev: Invoking the script, Up: Top
6 Special chars, variables
**************************
Together with the "keywords", the "special characters" and the
"variables" are the building block of scripts.
_Special characters_ have meta-meaning. _Variables_ are how
programming and scripting languages represent data.
* Menu:
<span style="background-color:#C4A000"><font color="#300A24">* Special Characters</font></span>:: Special Characters
<font color="#729FCF"><b>* Variable Substitution</b></font>:: Retrieving values of variables
<font color="#729FCF"><b>* Variable Assignment</b></font>:: The assignment operator
<font color="#729FCF"><b>* Untyped variables</b></font>:: Bash Variables Are Untyped
<font color="#729FCF"><b>* Variable Types</b></font>:: Special Variable Types
<span style="background-color:#FFFFFF"><font color="#300A24">-----Info: (bash-scripting-guide)Basics, 19 lines --All-------------------------</font></span>
</pre>
<p><b>Enable colors</b> in Info</p>
<p>The default configuration of Info in the terminal might be too
austere, for easier visual navigation it can be configured to display
the hypertext links with colors</p>
<pre>
$ info -v link-style=blue -v active-link-style=yellow -f bash-scripting-guide.info
</pre>
To set permanently create a config like this:
<pre>
$ cat ~/.infokey
#var
link-style=blue,bold
active-link-style=yellow,standout
match-style=bold
</pre>
<h3>Download and Install</h3>
<p>Your OS already comes with documentation in Info format, it resides
in <code>/usr/share/info</code>.<p>
<p>Common convention for all <b>external manuals</b> would be to be
kept in <b>a separate directory</b>, for example
<code>~/.local/share/info</code>. There a special file, named
<code>dir</code>, lists the documentation installed in it. To add to it
invoke <code>install-info</code>.</p>
<p>Download via URL:
<a href='bash-scripting-guide.info'>bash-scripting-guide.info</a>
(1.6M) in a browser of via <code>wget</code></p>
<pre>
$ mkdir -p ~/.local/share/info
$ cd ~/.local/share/info
$ wget https://hangar118.sdf.org/p/bash-scripting-guide-home/bash-scripting-guide.info
$ install-info --add-once bash-scripting-guide.info dir
</pre>
To inform Info about the custom folder, invoke via option
<code>--dir</code>
<pre>
$ info --dir ~/.local/share/info
</pre>
Or set <code>INFOPATH</code>
<pre>
$ export INFOPATH=~/.local/share/info
</pre>
To go directly to the manual bypassing the Dir page of Info do:
<pre>
$ info -f bash-scripting-guide
</pre>
<h3>Emacs</h3>
<p><b>Emacs</b> has a <b>built-in viewer</b> of Info documentation,
the Info directory is shared between Emacs and the standalone GNU Info
reader.</p>
To make this custom directory available to Emacs add this snippet to
your <code>init.el</code>:
<pre>
(add-to-list 'Info-default-directory-list "~/.local/share/info")
</pre>
<h3>Resources on GNU Info</h3>
<ul>
<li>
Official <a href='https://www.gnu.org/software/texinfo/'>project page</a> of GNU Info
</li>
<li>
<a href='https://en.wikipedia.org/wiki/Info_(Unix)'>Page</a> on Wikipedia
</li>
<li>
Other <a
href='https://www.emacswiki.org/emacs/ExternalDocumentation'>documentation
in Info</a> format available for download and install
</li>
</ul>
<h2>Contribute</h2>
The book is a cooperatively developed project on GitHub, contributions
are <b>welcome</b>:
<a href='https://github.com/pmarinov/bash-scripting-guide'>
https://github.com/pmarinov/bash-scripting-guide
</a>
<hr style='border: 1px dashed lightgray; margin-top: 4em;'/>
<small>
Contents of this page is public domain
<a rel="license"
href="http://creativecommons.org/publicdomain/zero/1.0/">
(CC0)</a>
</small>
</body>
</html>