Fading Coder

One Final Commit for the Last Sprint

Understanding Linux Environment Variables and Process Context

Process Execution and Context In a typical single-core CPU system, multiple processes do not run simultaneously but are executed concurrrently through rapid time-slicing. Each process is allocated a time slice; if it doesn't finish within that interval, the operating system saves its state and switc...

Shell Variable Management and Assignment Techniques

Variable Definition In Bash shell environments, all variable values are stored as strings regarrdless of whether quotes are used during assignment. This means Bash does not perform type differentiation by default - integers and decimals become string values, differing from most programming languages...

Customizing Ubuntu Terminal Prompt to Display Only Current Directory

Steps to Configure Terminal Prompt 1. Edit the Bash Configuration File Begin by opening the .bashrc file in your user home directory. For root users, this would be located at ~/.bashrc: nano ~/.bashrc Locate the line that defines the PS1 variable (typically starting with PS1=). To display only the...

Essential Comparison Operators in Shell Scripting

Shell scripts rely on comparison operators to evaluate conditions. These operators are primarily used with the [ ] test construct or the test command. They are categorized based on the data they evaluate: files, strings, and integers. File Test Operators These operators check the properties of a fil...

Shell Loop Constructs: Iterating Over Numbers, Strings, and Files

Shell scripts often require repetitive tasks. The for loop is a fundamental structure for iterating over sequences, lists, or file paths. This article covers three common types of for loops: numeric ranges, character strings, and patnhame expansion. Numeric Iteration Shell provides several ways to l...

Checking for Empty Values in Shell Scripts

Introduction In shell scripting, several operaotrs are used to test the state of files and dircetories. The -f operator checks if a path is a regular file, -d checks for a directory, -e verifies existence, and -s determines if a file has a non-zero size. Checking if a Variable is Empty You can use a...

Configuring NOI Linux for Competitive Programming

System Setup Setting up a productive environment on NOI Linux requires several key modifications. First, configure language settings and update package sources. The system includes backup source lists, making it easy to switch repositories using sudo cp. Install additional software packages includin...

Shell Variable Types: Environment Variables versus Regular Variables

Shell Script Fundamentals Script Interpreter The interpreter declaration must appear on the first line, starting with a shebang (#!): #!/bin/bash Different languages require different interpreters. The shebang tells the system which program to use for executing the script. Comments Comment lines use...

Shell Loop Constructs: for, while, until, and select

Shell scripts provide several loop mechanisms for repetitive task automation. This guide covers the main loop types available in Bash. Loop Types Overview Loop Type Purpose for Iterate over a list or sequence while Execute while a condition is true until Execute until a condition becomes true select...

Effective String Handling and Conditional Logic in Bash

In Bash environments, variables are inherently treated as text sequences. This behavior implies that numerical values are processed as strings during comparison operations unless explicitly arithmetic evaluation is invoked. Understanding how to validate string content and length is cirtical for robu...