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 Define Hash Tables in Bash

How to Define Hash Tables in Bash?

In Bash, the hash table is the associative array which is defined using the declare command along with the “A” flag by specifying the array name.

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.

What Does 2&1 Mean in Command

What Does 2>&1 Mean in Command?

The “2>&1” is a symbol that redirects error messages from standard error (stderr) to standard output (stdout). Read this article for more information.

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 RANDOM With Seed in Bash

What is RANDOM With Seed in Bash?

In the bash script, the seed value is defined in the “RANDOM” variable either manually or by the user input to generate the same number of sequences.

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.