Browsing Tag
bash
105 posts
How to Use Strings in Bash
Strings are something you work with in almost every Bash script you’ll ever write, whether you’re printing a…
How to Use Arrays in Bash
Arrays are one of those Bash features that a lot of people don’t touch for a long time,…
How to Pass Arguments to a Bash Script
Every reusable script I write eventually needs to accept some kind of input from the person or process…
How to Create Functions in Bash
Once a script grows past a few dozen lines, or once I find myself copy-pasting the same block…
How to Pipe Commands in Bash
If there’s one feature that captures the spirit of the Unix philosophy — small tools that do one…
How to Redirect Output in Bash
Redirection is one of those Bash fundamentals that quietly powers almost everything else you do in the shell…
How to Use Loops in Bash
If you’ve spent any time writing shell scripts, you already know that repeating the same command over and…
How to Use Conditional Statements in Bash
Every useful script eventually needs to make a decision. Should it delete the file or not? Is the…
How to Read User Input in Bash
A script that only ever does one fixed thing is useful, but a script that can respond to…
How to Perform Arithmetic in Bash
Bash wasn’t originally designed as a math-heavy language, but I still end up doing arithmetic in almost every…