#!/usr/bin/env bash size="$1" if [ -f size ] then if [ `cat size` = "$size" ] then exit 0 else echo "$0: size file preexists, but does not have the same value" 1>&2 exit 1 fi else # size file doesn't exist - just create it echo "$size" > size fi