Most programming languages support the concept of functions. Functions help you avoid writing the same piece of code again and again in the same program. You write the code once as function and then use this function where you need the specific
Read More
Loops are a powerful feature in any programming language. If you do not know already, the loops are a way to repeat the code based on certain criteria. For example, imagine that you have to print the numbers from 1 to 10.
Read More
Bash supports if-else statements so that you can use logical reasoning in your shell scripts. The generic if-else syntax is like this: if [ expression ]; then ## execute this block if condition is true else go to next elif [ expression
Read More
In most programming languages, you’ll find a string data type. A string is basically a group of characters. Bash shell is different though. There is no separate data type for strings. Everything is a variable here. But that doesn’t mean that you
Read More
In the earlier part of the series, you learned about variables. The variables can have a single value in it. Arrays can have several values inside it. This makes things easier when you have to deal with several variables at a time.
Read More
You can do a lot of things with bash scripts. Performing simple arithmetic operations with the variables is one of them. The syntax for arithmetic operations in the bash shell is this: $((arithmetic_operation)) Let’s say you have to calculate the sum of
Read More
Let’s have arguments… with your bash scripts 😉 You can make your bash script more useful and interactive by passing variables to it. Let me show you this in detail with examples. Pass arguments to a shell script When you run a
Read More
In the first part of the Bash Basics Series, I briefly mentioned variables. It is time to take a detailed look at them in this chapter. If you have ever done any kind of coding, you must be familiar with the term
Read More
This is the beginning of a new tutorial series on It’s FOSS. In this one, you’ll get familiar with bash scripting. The series assumes that you are somewhat familiar with the Linux terminal. You don’t have to be a master, but knowing
Read More