Open Source Articles

Page 75 of 123

Bash break How to Exit From a Loop

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 18K+ Views

If you are a Linux or Unix user, then you might be familiar with Bash shell. Bash is a popular command-line interpreter that is widely used in Linux, macOS, and other Unix-like operating systems. It is a powerful tool for running scripts, automating tasks, and working with command line. One of the most common use cases for Bash is working with loops, which allow you to repeat a set of instructions multiple times. However, sometimes you might need to break out of a loop before it has finished executing. In this article, we will explore how to exit from a ...

Read More

Bash Continue How to Resume a Loop

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 3K+ Views

Bash is a popular command-line interface shell used extensively in Linux and Unix operating systems. One of its most useful features is the ability to execute loops, which automate repetitive tasks. Sometimes you may need to skip certain iterations within a loop or control its flow. This is where the Bash continue statement becomes essential. What is a Bash Loop? A loop is a programming construct that executes a block of code repeatedly. Bash supports several types of loops including for loops (which iterate over a set of values) and while loops (which execute as long as a ...

Read More

Bash declare Statement Syntax and Examples

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 8K+ Views

The declare statement is a built-in Bash command that allows you to set attributes for variables and control their behavior. When you declare a variable using declare, you can specify how Bash should treat that variable − whether it's an array, integer, read-only, or has other special properties. Syntax of Declare Statement The basic syntax of the declare statement is straightforward − declare [options] variable=value Where declare is the keyword, [options] are flags that set specific attributes, and variable=value assigns a value to the variable. Common Declare Options Option ...

Read More

Bash Export Variable

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 10K+ Views

Bash is one of the most commonly used shells in Unix-based operating systems. It provides a command-line interface that allows users to interact with the system and execute various commands. One of Bash's key features is the ability to export variables, making them available to child processes as environment variables. In this article, we will explore the fundamentals of exporting variables in Bash, including syntax, usage patterns, and practical examples for system administration and scripting tasks. What is a Bash Export Variable? A Bash export variable is a variable that is made available to all child processes ...

Read More

Bash HereDoc Tutorial With Examples

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 3K+ Views

If you're a Linux or Unix user, you're probably familiar with Bash, the command-line shell that's commonly used on these systems. Bash has a lot of powerful features that can make working on the command line much more efficient, and one of those features is called a HereDoc. In this tutorial, we'll explain what a HereDoc is, how it works, and give you some examples of how you can use it in your Bash scripts. What is a HereDoc? A HereDoc, short for "Here Document, " is a way to include a block of text within a Bash ...

Read More

Bash if elif else Statement A Comprehensive Tutorial

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 17K+ Views

The Bash if-elif-else statement is a fundamental control structure that allows you to execute different blocks of code based on conditions. This conditional construct enables you to create decision-making logic in your Bash scripts, making them more dynamic and responsive to different scenarios. What is Bash if-elif-else Statement? The Bash if-elif-else statement evaluates conditions sequentially and executes the code block associated with the first true condition. If a condition is true, the corresponding code block runs and the remaining conditions are skipped. If none of the conditions are true, the else block executes (if present). Syntax of ...

Read More

Bash Math Operations (Bash Arithmetic) Explained

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 3K+ Views

Bash arithmetic refers to mathematical operations that can be performed within Bash scripts using special syntax. Bash provides built-in support for integer arithmetic operations, making it easy to perform calculations directly in shell scripts without external tools. This article explores the fundamentals of Bash arithmetic, including syntax, operators, and practical examples for performing mathematical calculations in shell scripts. Basic Syntax Bash arithmetic uses the $(( )) syntax to evaluate mathematical expressions. The basic format is − $(( expression )) The expression can include variables, numbers, and arithmetic operators. The double parentheses tell Bash ...

Read More

Bash Function & How to Use It {Variables, Arguments, Return}

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 5K+ Views

Bash functions are an essential feature of the Bash shell, allowing you to group commands and reuse them throughout your scripts. A Bash function is essentially a block of code that can be called and executed at any point in your script. In this article, we will explore the basics of Bash functions and learn how to use them effectively with variables, arguments, and return values. Defining a Bash Function To define a Bash function, you can use the function keyword followed by the name of your function, or simply use the function name followed by parentheses. Here's ...

Read More

Escaping Characters in Bash on Linux

Kunal Verma
Kunal Verma
Updated on 17-Mar-2026 556 Views

Character escaping in Bash is a fundamental concept that allows you to control how special characters are interpreted by the shell. Since many characters have special meanings in Bash (like $, &, *), escaping lets you use their literal values when needed. This tutorial covers the different string types in Bash and demonstrates various methods for escaping characters to preserve their literal meaning. String Types in Bash Bash handles strings differently based on how they are quoted. Understanding these differences is crucial for proper character escaping. Single Quotes Single quotes (') preserve the literal value ...

Read More

Display System Information in CLI with Neofetch

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 544 Views

As a computer user, it's important to know the specifications and operating system information of the machine you're working with. This information can be helpful in troubleshooting issues or optimizing your system for better performance. While there are many graphical user interface (GUI) tools that can display this information, there are also command-line interface (CLI) tools that can do the same job. One such tool is Neofetch, a CLI system information tool that can display a variety of information about your system in an attractive, easy-to-read format. What is Neofetch? Neofetch is a command-line system information tool written ...

Read More
Showing 741–750 of 1,225 articles
« Prev 1 73 74 75 76 77 123 Next »
Advertisements