December 2018
Beginner
452 pages
12h 17m
English
As a little bonus, we have a slight improvement for the test-shorthand.sh script. In the previous chapter, we explained that, if we have to use the same value multiple times in a script, we're better off making it a variable. If the value of the variable does not change during the script's execution and is not influenced by user input, we use a CONSTANT. Take a look at how we would incorporate that in our previous script:
reader@ubuntu:~/scripts/chapter_09$ cp test-shorthand.sh test-shorthand-variable.shreader@ubuntu:~/scripts/chapter_09$ vim test-shorthand-variable.sh reader@ubuntu:~/scripts/chapter_09$ cat test-shorthand-variable.sh #!/bin/bash###################################### Author: Sebastiaan Tammer# Version: ...