# HG changeset patch
# User Jeff Hammel <jhammel@mozilla.com>
# Date 1370705715 25200
# Node ID ae1346f776c35faaf4a0caa9ab5a79fb4630767d
# Parent  b2924a3ae4f36ca2cc97bb8948251407242b18ff
hopefully finished....we shall see!

diff -r b2924a3ae4f3 -r ae1346f776c3 bin/example/self-writing.sh
--- a/bin/example/self-writing.sh	Sat Jun 08 08:30:37 2013 -0700
+++ b/bin/example/self-writing.sh	Sat Jun 08 08:35:15 2013 -0700
@@ -18,9 +18,15 @@
 
 # avoiding -i for safety
 sed 's/\(echo \"'"${nonce}"'\).*\"/\1'"${datestamp}"'\"/' ${path} > ${tmp}
+if [[ ! -e "${tmp}" ]]
+then
+    echo "Temporary file creation not successful"
+    exit 1
+fi
 
 # echo last and current generation times for example
 echo "This script last generated at (None)"
 echo "Now: ${datestamp}"
 
-# move tmpfile -> script location via exec
\ No newline at end of file
+# move tmpfile -> script location via exec
+exec mv ${tmp} ${path}