Bash

Emulating a do-while loop in Bash

Emulating a do-while loop in Bash

The user can emulate the do-while loop in the bash script using the while loop syntax with “do”
that executes when the condition is true.

What Does_Mean in Bash

What Does <<< Mean in Bash?

In Bash, the “<<<” operator means “here strings.” It allows users to pass a string as the standard input to a command via the “command <<< string” syntax.

How to Create a List in Bash

How to Create a List in Bash?

There is no existence of a list data type in the bash script, but the list can be generated using the for and while loops or arrays.

Boolean Operators in Bash Script

Boolean Operators in Bash Script

The bash script has three boolean operators: AND, OR, and NOT. These operators have been discussed in detail in this article, along with examples.

How to Compare Numbers in Bash

How to Compare Numbers in Bash?

There are various ways to compare numbers in bash Linux, such as using if, nested if, or loops. These methods have been discussed along with examples.

How to Update .bashrc_ and Reload

How to Update `.bashrc` and Reload?

To update the “.bashrc” file in Linux, open the “.bashrc” file with the nano editor, update the file, and reload it via the “source” command.

How to Use Expressions $(()), (()) in Bash

How to Use Expressions $(()), (()) in Bash?

To perform calculations in bash the expression “(())” and “$(())” are used, the “$(())” returns the results while “(())” doesn’t and is applied on conditions.

What is $$ in Bash Shell Script

What is $$ in Bash Shell Script?

In Linux, the bash shell variable “$$” returns the current bash shell process id that can be checked through the “echo” and the “ps(process)” commands.

How to Argument String to Integer in Bash

How to Argument String to Integer in Bash?

To convert the argument string to an integer using the “$((…))” arithmetic expansion operator, “expr,” “let,” “bc,” and “awk” commands in the bash script.

Bash Multiplication and Addition

Bash Multiplication and Addition

In Linux, the bash addition and multiplication operations can be performed using the “arithmetic expansion,” “expr,” and the “let” command line utility.

How Do I Create a Permanent Bash Alias

How to Make a Permanent Alias in Zsh?

In Linux, to make permanent aliases in the Zsh shell, the “.zshrc” file is utilized. Open this file with any editor, add the aliases, and execute it.

What is _declare_ in Bash

What is “declare” in Bash?

In Bash, the “declare” command sets the variable and functions alongside their attributes, “integer”, “string”, “array”, and “read-only” variables.

Bash for Loop With Range (#..#}

Bash for Loop With Range {#..#}

To define the set of ranges in the for loop of the bash script, the “{#..#}” syntax is followed by the starting and the ending range.

What is the _eval_ Command in Bash

What is the “eval” Command in Bash?

In Bash, the “eval” command evaluates its arguments as a shell script including “commands”, “variables”, “arithmetic expressions”, and “strings”.

Bash For Each Line in File

Bash For Each Line in File

To implement the for each line operation on a file, the for loop is used in Bash scripting. This can be used to read each line of a file.

How to Use the cat Command in Bash

How to Use the cat Command in Bash?

Learn how to use the bash’s powerful “cat” command. Our comprehensive guide covers everything to make you master this command in no time!

How to Clear Bash History in Linux

How to Clear Bash History in Linux?

Linux offers the “history” command with the “c” option to clear the bash history. It removes all the records of previously entered commands in the terminal.

How to Write to File in Bash

How to Write to File in Bash?

Several methods are discussed to write to a file in bash, which helps to write single or multiple lines and the same content to multiple files simultaneously.

Bash Heredoc Explained

Bash Heredoc | Explained

We can use the Bash heredoc method in Linux to execute multiple lines of commands and data simultaneously, which is explained in this guide with examples.

Bash until Loop Explained

Bash until Loop | Explained

In Bash, the until loop iterates the code until the specified condition is met. Using the until loop, users can modify conditions according to requirements.

Bash Select (Make Menus)

Bash Select (Make Menus) | Explained

Easily create interactive menus in Linux using “bash select”. Allow users to choose from a list of options and navigate your command-line program or script.

Bash Shebang Explained

Bash Shebang | Explained

The “bash” shebang is a first-line interpreter used to execute the “bash” scripts. It starts with “#!” symbols and the absolute path to a binary file.

Bash exit command and exit codes

Bash Exit Command and Exit Codes

The bash exit command quits the terminal or script and shows a specific exit code based on the command execution that can be used for conditional exiting.

Bash Break and Continue

Bash Break and Continue

Learn more about the usage of ‘break’ and ‘continue’ in bash scripting and control the flow of a loop by terminating and skipping the code.

Bash Append to File

How to Append to File in Bash?

Three methods are used to append the data to the bash file in Linux, which are the redirect operator (>>), cat, and tee commands, as discussed in this guide.

Bash while loop

Bash while Loop | Explained

Learn how to use the bash while loop to execute a set of commands repeatedly until a specified condition is met. It can help you automate your tasks.

Bash Loops Explained

Bash Loops | Explained

Bash loops are an essential part of any programming language as they will automate repetitive tasks to save time and minimize the lines of code.

bash if else with examples

bash if else With Examples

The bash if-else statement will let you decide certain aspects of code that you want to execute and others that you want to ignore.