#!/bin/sh tmpfile=$(mktemp ~/.bsp.XXXXXX) || exit 1 bsp -o $tmpfile "$1" || { rm -f $tmpfile; exit 1; } mv -f $tmpfile "$1" && chmod go+r "$1" .