Understanding Bash built-ins and grammar
Let’s get back to the fundamentals before we start creating a script. First, we will look into the Bash scripting language syntax and its limitations.
Built-in commands are commands that are integral to Bash and are the main scripting syntax we are going to use. Bash will try to execute any other commands from the system it runs on.
Just like any other interpreted language (for example, Python or Ruby), Bash has unique syntax and grammar. Let’s look into it.
Bash, similar to other programming languages, interprets files from top to bottom and from left to right. Each line usually contains one or more commands. You can glue several commands together in one line using a pipe (|
) or double pipe character (||
), semicolon (;
), or double ampersands (&&
). It’s useful to remember that double pipes have the same function as logical OR
and double ampersands have the same function as logical AND
. This way, you can...