Summary

Within this chapter, I really hope that we have introduced many new and interesting choices to you. This was an area with a wide range where we began recapping on the use of test and discovered that the [ is a command is not a syntax construct. The main effect that it is a command is on whitespace and we looked at the need to quote variables.

Even though we may commonly call variables as variables. We have also seen that their correct name, especially in documentation is parameters. Reading a variable is a parameter expansion. Understanding parameter expansion can help us understand the use of the keyword [[. The double square brackets are not commands and do not expand the parameters. This means that we do not need to quote variables even if they do contain whitespace. Moreover, we can use advanced tests with double square brackets, such as pattern matching or regular expressions.

Finally, we looked at arithmetic expansion and parameter manipulation using the double parenthesis notation. The biggest feature this delivers is the possibility to easily increment and decrement counters.

In the next chapter, we will move into the looping constructs found in bash and make use of some of our new found skills from this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.206.232