LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

Here Today, Gone When You Exit: Proper Tempfiles in Shell Scripts

Tags: , , , , Date/Time: April 9, 2022 @ 2:53 pm, by raindog308

In the course of my career, I’ve periodically come across code like this in shell scripts: TEMP_FILE=/tmp/tempfile Or sometimes, slightly more elegantly: TEMPFILE=/tmp/tempfile.$$ The problems with the first example are obvious, especially if it appears in many different scripts.  The second is better.  The “$$” means “my process ID”, who if whatever script had a […]

Replacing That Big Fat Bash

Tags: , , , Date/Time: February 9, 2009 @ 1:31 am, by LowEndAdmin

It’s actually a tip from Lincoln, who emailed me last month: Another idea is to replace bash (~4M/instance) with pdksh (~1M/instance). It doesn’t sound like much, but if you’re like me and you’re have a half-dozen or more concurrent ssh sessions, plus you’re su’ed on a couple of them, etc… it can be a significant […]