Operating System Articles

Page 118 of 171

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 545 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

Consistency Semantics for File Sharing

Arnab Chakraborty
Arnab Chakraborty
Updated on 17-Mar-2026 2K+ Views

File-sharing services have become an integral part of modern communication and collaboration. These services allow users to share files with others, enabling them to work together on projects and exchange information. However, with multiple users accessing and updating the same file simultaneously, the problem of data consistency arises. Data consistency refers to the correctness and reliability of data, ensuring that all users see the same view of the data at all times. Consistency semantics is a set of rules that define how data is accessed and updated by different users in a distributed system. It ensures that all users ...

Read More

Convoy Effect in FCFS

Arnab Chakraborty
Arnab Chakraborty
Updated on 17-Mar-2026 4K+ Views

In computer operating systems, scheduling algorithms play a crucial role in managing the execution of multiple processes. The First-Come-First-Serve (FCFS) scheduling algorithm follows a sequential order in executing processes as per their arrival time in the system. Although FCFS is straightforward and easily implementable, it may result in the Convoy Effect, where a resource-intensive process monopolizes system resources and creates a backlog of smaller processes, causing delays and inefficiencies. First Come First Serve (FCFS) Scheduling First-Come-First-Serve (FCFS) is a non-preemptive scheduling algorithm where processes are executed in the order they arrive in the ready queue. When a process ...

Read More
Showing 1171–1180 of 1,707 articles
« Prev 1 116 117 118 119 120 171 Next »
Advertisements