Tagged articles
6 articles
Page 1 of 1
MaGe Linux Operations
MaGe Linux Operations
Apr 7, 2024 · Fundamentals

Mastering sed: Variable Substitution, Quoting, and Advanced Tricks

This article explains how to correctly use shell variables and variable substitution in sed, clarifies quoting rules, demonstrates retrieving the last N lines, handling backreferences, the -i option, greedy matching, the interplay of a and N commands, exclamation negation, and troubleshooting high CPU usage.

quotingregexsed
0 likes · 15 min read
Mastering sed: Variable Substitution, Quoting, and Advanced Tricks
Liangxu Linux
Liangxu Linux
Feb 15, 2023 · Fundamentals

5 Common Bash Variable Mistakes and How to Avoid Them

This guide shares five practical tips to prevent frequent Bash variable errors—such as spacing around the equals sign, array syntax, quoting rules, command substitution, and naming conflicts with environment variables—helping developers write reliable shell scripts.

ArraysBashbest-practices
0 likes · 5 min read
5 Common Bash Variable Mistakes and How to Avoid Them
DevOps Cloud Academy
DevOps Cloud Academy
Jun 12, 2018 · Fundamentals

Using Numeric Operators and Variable Assignment in Shell Scripts

This article explains how to perform arithmetic with the expr command, assign results to variables, extract information using command substitution, and correctly apply quoting and backticks in Bash to handle spaces, special characters, and nested commands.

ArithmeticVariable Assignmentcommand substitution
0 likes · 4 min read
Using Numeric Operators and Variable Assignment in Shell Scripts
ITPUB
ITPUB
May 26, 2016 · Fundamentals

Mastering Shell Command Substitution: Backticks vs $() and Escape Tricks

This article explains shell command substitution, comparing backticks and the modern $(…) syntax, details their handling of special characters, demonstrates nesting and backslash escaping tricks across various shells, and provides practical examples and solutions for reliable quoting and path handling.

Bashcommand substitutionescaping
0 likes · 10 min read
Mastering Shell Command Substitution: Backticks vs $() and Escape Tricks
ITPUB
ITPUB
May 24, 2016 · Fundamentals

Why Does a Backslash Behave Differently in Bash and Ksh? Master Shell Quoting

This article explains literal versus meta characters in shells, the three quoting methods (escape, strong, weak), and demonstrates why printing backslashes with echo requires different numbers of backslashes in Bash and Ksh, including work‑arounds like the -E option and set -x debugging.

BashEscape Characterscommand line
0 likes · 8 min read
Why Does a Backslash Behave Differently in Bash and Ksh? Master Shell Quoting
MaGe Linux Operations
MaGe Linux Operations
Apr 24, 2016 · Fundamentals

13 Essential Shell Questions Every Linux Beginner Should Know

This article compiles thirteen fundamental Linux shell questions covering the origin of the term "shell", the relationship between PS1 and carriage return, echo command usage, differences between single and double quotes, variable assignment, export behavior, and practical quoting techniques, providing clear explanations and examples for each.

environment variablesquotingvariables
0 likes · 25 min read
13 Essential Shell Questions Every Linux Beginner Should Know