June 2025
Beginner to intermediate
1180 pages
37h 48m
English
As I mentioned when describing the examples from the previous section, bash scripts must start with the line #!/bin/bash. This line, the so-called shebang or hashbang, specifies by which interpreter the following code is executed—in the examples in this chapter, by bash.
Shell scripts can only be executed if the access bits for read access (r) and execution (x) are set. The r bit is set by default for new files anyway, but you have to take care of the x bit (for execute) yourself once:
user$ chmod +x myscript If you write a collection of your own shell script programs for daily use, it makes sense to store them in a central location.
The best directory to use is ~/bin. If you then make the following change ...
Read now
Unlock full access