Notes

Home About Contact Archive
GitHub LinkedIn Twitter CoBUG.org

Hey Kid, I'ma Interpreter!! Stop all the static interpreter referenci'n!

Please stop using '/bin/bash'!
Posted on Mon, 17 Mar 2014 13:00:00 MDT by Aaron Bieber
Tags: Scripting, OpenBSD

If you have ever explicitly set the path of an interpreter at the top of a script.. This post is about you.

STOP IT!

Not every system has binaries in the same location!

#!/bin/bash

The above might seem awesome, and it might be tempting to use it, but if you do, and your project is something that I am interested in, you will receive a pull request (here are some examples) to change it to:

#!/usr/bin/env bash

On OpenBSD, bash is not in base, meaning it is not installed in /bin or even /usr/bin. It gets plopped right into /usr/local/bin. Almost all users will have /usr/local/bin set in their PATH variable, so use the above and do not be a turdburgler!


Made by qbit. Subscribe via RSS / Atom | Generated using boring and these files.
PGP: 0x1F81112D62A9ADCE / 3586 3350 BFEA C101 DB1A 4AF0 1F81 112D 62A9 ADCE
proof.