Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am cmcaine on github.
  • I am cmcaine (https://keybase.io/cmcaine) on keybase.
  • I have a public key ASCOMPSgeIAYH7NhsSc63AVMLrYu0yfC81zQa2aR21iungo

To claim this, I am signing this object:

@cmcaine
cmcaine / swap
Last active October 13, 2016 00:48
Swap two files reasonably safely
#!/bin/sh
# Swap two files safely.
#
# Under normal circumstances, just do the right thing. Under unusual
# circumstances, give a reasonably helpful error message.
#
# This was an exercise in thinking about how generally reliable functions might
# fail and what to communicate to users.
#
# Copyright Colin Caine. License: GPLv2