Bash Scripting Sunday #5: Safely Working with Temporary Files in Bash

This week in Bash Scripting Sunday, we’re diving into a small topic with a big impact: handling temporary files safely and securely. Temporary files are common in scripting — for holding intermediate data, logs, or scratch work. But if you’re using something like: tmpfile="/tmp/myscript.tmp" …you might be exposing yourself to race conditions, file collisions, or even security issues. Let’s fix that. 🛠️ 🧪 The Problem with Hardcoded Temp Files Hardcoding paths like /tmp/foo.txt can lead to problems: ...

April 6, 2025 · 2 min · MeaTLoTioN

Bash Scripting Sunday #4: Creating a Simple Interactive Menu in Bash

In this week’s Bash Scripting Sunday, we’re diving into creating simple interactive menus in Bash. If you’ve ever wanted to give your scripts a bit of user interactivity—like choosing from a list of options—you’ll love this one. 🧭 Why Use Menus? Menus are great when: You want to prompt the user for input from a list You’re writing utility scripts with multiple actions You want something more user-friendly than raw read input 🔧 The Basics: select and PS3 Bash comes with a built-in construct called select that makes menus easy. ...

March 30, 2025 · 3 min · MeaTLoTioN

Bash Scripting Sunday #3: Using xargs Effectively – More Than Just a Pipe

When dealing with large lists of files or data in Bash, it’s tempting to throw everything into a loop or use while read pipelines. But there’s a better tool that often gets overlooked: xargs. In this week’s Bash Scripting Sunday, let’s dive into how to use xargs more effectively – and why it’s so much more than just a glorified pipe. 🧠 What is xargs? xargs takes input from stdin and converts it into arguments for a command. ...

March 23, 2025 · 3 min · MeaTLoTioN