Bash Script – Command Substitution
In order to understand command substitution, let us first discuss substitution in shell scripts. Substitution is a functionality by following which we can instruct the shell to substitute the actual value of an expression....
read more
Bash Scripting – If Statement
Bash is an interpreter for command languages. It is a default command interpreter on most GNU/Linux systems and is widely available on various operating systems. The name is an abbreviation for Bourne-Again SHell. Scripting enables for the execution of instructions that would otherwise be executed one by one interactively....
read more
Bash Scripting – Substring
sIn this article, we will discuss how to write a bash script to extract substring from a string....
read more
Bash Script – Define Bash Variables and its types
Variables are an important aspect of any programming language. Without variables, you will not be able to store any required data. With the help of variables, data is stored at a particular memory address and then it can be accessed as well as modified when required. In other words, variables let you store, read, access, and manipulate data....
read more
Bash Scripting – How to Run Bash Scripting in Terminal
In this article, we are going to see how to run bash script in terminal. For example, we create a bash file set of instructions or commands ( known as bash script ), and through command, we can run this file in terminal....
read more
Bash Scripting – How to check If File Exists
In this article, we will write a bash script to check if files exist or not....
read more
Bash Script – Quotes and its types
Quoting in bash scripting is a process to make variables or any other container for data to be expanded to the literal value inside any string, quoting is also used for other operations as well. There are several types of quoting techniques in a bash script. In this article, we will see the different types of quoting in Bash scripting....
read more
Bash Scripting – File Extension
Bash scripting is a powerful tool for automating tasks and working with files in the command line. One important aspect of working with files in bash is understanding how to handle file extensions. In bash, a file extension is the portion of a file name that follows the last period (.) in the file name. For example, in the file name “file.txt“, the file extension is “txt“. File extensions are used to indicate the type of file and to determine which programs should be used to open the file....
read more
How to Defining a Bash Variable With or Without ‘export’ in Linux
A variable is a basic building block that stores a value at a specific memory location, and every operation performed on a variable affects that memory location. Values ​​stored in variables can be changed or deleted during program execution. The main difference with bash variables is that they don’t need to be declared. Just assign the value of the variable using the variable name....
read more
Bash Script – Arithmetic Operators
In this article, we will see arithmetic operators in bash script. Arithmetic operators is used to perform arithmetic operations....
read more
Bash Scripting – Case Statement
A case statement in bash scripts is used when a decision has to be made against multiple choices. In other words, it is useful when an expression has the possibility to have multiple values. This methodology can be seen as a replacement for multiple if-statements in a script. Case statements have an edge over if-statements because it improves the readability of our code and they are easier to maintain. Case statements in a Bash script are quite similar to Case statements in C language. But unlike C, the Bash Case statement stops continuing the search as soon as the match occurs. In simple words, they don’t require any break statement that is mandatory to be used in C to stop searching for a pattern further....
read more
Bash Scripting – Array
Arrays are important concepts in programming or scripting. Arrays allow us to store and retrieve elements in a list form which can be used for certain tasks. In bash, we also have arrays that help us in creating scripts in the command line for storing data in a list format. In this article, we will understand the basics of arrays in bash scripting....
read more