Skip to content

Commit f16d7c9

Browse files
committed
Minor fixes
1 parent 685883f commit f16d7c9

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

manuscript/BashScripting/tools.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ There are three ways to run an application in Bash:
4949
2. By the absolute path.
5050
3. By the relative path.
5151

52-
The first approach is the most convenient. However, you need to add the installation path of the application to the `PATH` variable. Then Bash can find the program's executable when you call it.
52+
The first approach is the most convenient. You need to add the installation path of the application to the `PATH` variable. Then Bash can find the program's executable when you call it.
5353

5454
Let's consider how to run the Notepad++ editor by the executable name. The program has the following installation path by default:
5555
{line-numbers: false}
@@ -175,7 +175,9 @@ If the `test.txt` file does not exist, Notepad++ shows you the dialog to create
175175

176176
Suppose that you run a GUI application in the terminal window. Then you cannot use this window for typing the Bash commands. The GUI program controls it and prints the diagnostic messages there. The terminal window becomes available again when the application finishes.
177177

178-
You can run the GUI application in the **background mode**. Then the terminal window stays available, and you can use it normally. Add the ampersand & at the end of a Bash command to launch it in the background mode. Here is an example:
178+
You can run the GUI application in the **background mode**. Then the terminal window stays available, and you can use it normally.
179+
180+
Add the ampersand & at the end of a Bash command to launch it in the background mode. Here is an example:
179181
{line-numbers: false, format: Bash}
180182
```
181183
notepad++ test.txt &
@@ -231,5 +233,4 @@ You can call Notepad++ and detach it from the terminal in a single command. In t
231233
{line-numbers: false, format: Bash}
232234
```
233235
notepad++ test.txt & disown $!
234-
```
235-
236+
```

manuscript/BashScripting/variables.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -1008,13 +1008,10 @@ unset 'contacts[Bob]'
10081008
Bash can insert several elements of an associative array in the same way as it does for an indexed array. Here is an example:
10091009
{line-numbers: true, format: Bash}
10101010
```
1011-
$ echo "${contacts[@]:Bob:2}"
1012-
(697) 955-5984 [email protected]
1011+
$ echo "${contacts[@]:0:2}"
1012+
[email protected] (245) 317-0117
10131013
```
10141014

1015-
Here you get two elements printed:
1016-
1017-
* The one that corresponds to the `Bob` key.
1018-
* The next one in memory.
1015+
Here you get the first two elements of the array.
10191016

10201017
There is one problem with inserting several elements of an associative array. Their order in memory does not match their initialization order. The [**hash function**](https://en.wikipedia.org/wiki/Hash_function) calculates a numerical index in the memory of each element. The function takes a string-key on input and returns a unique integer on output. Because of this feature, inserting several elements of the associative array is a bad practice.

manuscript/finalwords.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
Here we finish our introduction to Bash. We have covered the language basics only. This book skips several important Bash topics. You will need them if you plan to use Bash for professional software development.
44

5-
Here is the list of advanced topics that you need for further development of your Bash skills:
5+
Here are the topics that would be a good start for advanced learning of Bash:
66

7-
* [Manipulating strings](https://tldp.org/LDP/abs/html/string-manipulation.html).
7+
* [Strings manipulation](https://tldp.org/LDP/abs/html/string-manipulation.html).
88

99
* [Regular expressions](https://tldp.org/LDP/abs/html/x17129.html).
1010

1111
* [The `sed` stream editor](https://tldp.org/LDP/abs/html/x23170.html).
1212

1313
* [The `awk` text processing language](https://tldp.org/LDP/abs/html/awk.html).
1414

15+
I> GNU utilities `sed` and `awk` are not part of Bash. However, they give you advanced features for processing strings.
16+
1517
These topics are material for advanced study. You can skip them if you are using Bash for simple tasks and basic automation only.
1618

1719
Perhaps you liked writing programs. Now you want to know more about this topic. What is the next step after reading this book?
@@ -28,7 +30,9 @@ The second option is the new language has many domain-specific features that are
2830

2931
There is one important conclusion of the typical language development process. All modern general-purpose languages have strong advantages in a few domains only. No language fits any tasks perfectly. It means that the domain dictates you the language to use.
3032

31-
Let's come back to our question regarding your next step. You have read this book. Now it is time to choose the applied domain that is interested to you. How can you do it? You already know something about software from your user experience. Read articles on the Internet about the programs that you use every day. Think about them this way: do you want to develop similar programs? It can happen that your user experience will help you to find the right applied domain.
33+
Let's come back to our question regarding your next step for learning programming. You have read this book. Now it is time to choose the applied domain that is interested to you. How can you do it?
34+
35+
You already know something about software from your user experience. Read articles on the Internet about the programs that you use every day. Think about them this way: do you want to develop similar programs? It can happen that your user experience will help you to find the right applied domain.
3236

3337
Suppose that you find the applied domain that you want to learn. The next step is choosing the appropriate programming language that fits this domain well.
3438

@@ -41,7 +45,7 @@ Table 5-1 will help you to find the right programming language for your applied
4145
| | |
4246
| [Web applications](https://en.wikipedia.org/wiki/Web_application) ([front end](https://en.wikipedia.org/wiki/Front_end_and_back_end)) | JavaScript, PHP, HTML5, CSS, SQL |
4347
| | |
44-
| [Web applications](https://en.wikipedia.org/wiki/Web_application) ([back end](https://en.wikipedia.org/wiki/Front_end_and_back_end)) | JavaScript, PHP, Ryby, Perl, C#, Java, Go |
48+
| [Web applications](https://en.wikipedia.org/wiki/Web_application) ([back end](https://en.wikipedia.org/wiki/Front_end_and_back_end)) | JavaScript, Python, Ryby, Perl, C#, Java, Go |
4549
| | |
4650
| [High Load Systems](https://en.wikipedia.org/wiki/Server_(computing)) | C++, Python, Ruby, SQL |
4751
| | |
@@ -65,7 +69,7 @@ I hope that you learned something new from this book and had an enjoyable time w
6569

6670
If you have any questions or comments about this book, please write to me here: [[email protected]](mailto:[email protected]). Also, you can ask questions in the "Issues" section of the [GitHub repository of the book](https://github.com/ellysh/bash-programming-from-scratch/issues).
6771

68-
Thank you for reading "Bash programming from scratch"!
72+
Thank you for reading ["Bash programming from scratch"](https://leanpub.com/bash-programming-from-scratch/)!
6973

7074
# Acknowledgements
7175

@@ -77,4 +81,4 @@ Thanks to Vitaly Lipatov for introducing me to Linux and Bash. He taught me prog
7781

7882
Thanks to Ruslan Piasetskyi for consulting on some Bash topics. He explained to me the idioms and pitfalls of the language.
7983

80-
Thanks also to everyone who supported me and motivated me to finish this work.
84+
Thanks also to everyone who supported me and motivated me to finish this work.

manuscript/package-manager.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Each Unix environment provides a special program for accessing the repository. I
2020

2121
Why does the Unix environment need a package manager? Windows does not have such a program. Users of this OS download all software from the Internet and install it manually.
2222

23-
I>There are several third-party package managers for Windows. The most popular one is [Chocolatey](https://chocolatey.org). Microsoft plans to develop the [official package manager](https://devblogs.microsoft.com/commandline/windows-package-manager-1-0) in the nearest future.
23+
I> There are several third-party package managers for Windows. The most popular one is [Chocolatey](https://chocolatey.org). Microsoft plans to develop the [official package manager](https://devblogs.microsoft.com/commandline/windows-package-manager-1-0) in the nearest future.
2424

2525
The package manager installs and removes packages from the Unix environment. Its main task is to keep track of **package dependencies**. Suppose that some program from one package uses features of the library from another package. Then the first package depends on the second one. It means that you should install the second package whenever you install the first one.
2626

0 commit comments

Comments
 (0)