Simon Willison’s Weblog

Subscribe

10 items tagged “bash”

2024

lsix (via) This is pretty magic: an ls style tool which shows actual thumbnails of every image in the current folder, implemented as a Bash script.

To get this working on macOS I had to update to a more recent Bash (brew install bash) and switch to iTerm2 due to the need for a Sixel compatible terminal.

# 6th June 2024, 10:07 pm / bash

# All the code is wrapped in a main function that gets called at the bottom of the file, so that a truncated partial download doesn't end up executing half a script.

tailscale.com/install.sh

# 29th April 2024, 9 pm / bash, tailscale

2022

A tiny CI system (via) Christian Ştefănescu shares a recipe for building a tiny self-hosted CI system using Git and Redis. A post-receive hook runs when a commit is pushed to the repo and uses redis-cli to push jobs to a list. Then a separate bash script runs a loop with a blocking “redis-cli blpop jobs” operation which waits for new jobs and then executes the CI job as a shell script.

# 26th April 2022, 3:39 pm / bash, continuous-integration, git, redis

2019

flk: A LISP that runs wherever Bash is (via) This is a heck of a project: an implementation of LISP written entirely in Bash, meaning you can run it as a script on any machine that has a Bash installation.

# 4th December 2019, 5:19 am / bash, lisp

2017

direnv (via) A shell extension (for bash, zsh and others) which can automatically set and unset environment variables when you cd into specific directories. Useful for managing things like a project’s GOPATH or automatically activating Python virtual environments.

# 5th November 2017, 7:59 pm / bash, shell, zsh

2012

What is a good programming language to learn after bash scripting?

Python is a good natural progression from bash in my opinion. It has an interactive prompt which supports bash-style exploratory programming, and it has libraries that mean it can be applied to an enormous range of problems—everything from game development to scientific computing to web applications.

[... 65 words]

2010

Using Bash’s History Effectively. The HISTIGNORE environment variable is particularly useful, allowing you to suppress certain commands by specifying a pattern. This article has a tip for causing a command to be omitted from the history if you prefix it with a space.

# 25th February 2010, 12:21 pm / bash, commandline

2009

shunit2 (via) xUnit style testing for shell scripts.

# 27th September 2009, 7:34 pm / bash, shell, shunit2, testing, unittesting, unix, xunit

BashReduce. Map/Reduce in Bash is no longer a joke project (if it ever was)—Richard Crowley is extending it and using it for analysis at OpenDNS.

# 28th June 2009, 3:03 pm / bash, bashreduce, mapreduce, opendns, richardcrowley

resty. 58 lines of bash provides a better command-line interface to RESTful APIs, using curl under the hood. This should save me from running “man curl” several times a week.

# 18th May 2009, 1:07 pm / apis, bash, commandline, curl, rest, resty