Mercurial > hg > config
comparison bin/example/self-writing.sh @ 324:ae1346f776c3
hopefully finished....we shall see!
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 08 Jun 2013 08:35:15 -0700 |
parents | b2924a3ae4f3 |
children | bc2d0d504270 |
comparison
equal
deleted
inserted
replaced
323:b2924a3ae4f3 | 324:ae1346f776c3 |
---|---|
16 exit 1 | 16 exit 1 |
17 fi | 17 fi |
18 | 18 |
19 # avoiding -i for safety | 19 # avoiding -i for safety |
20 sed 's/\(echo \"'"${nonce}"'\).*\"/\1'"${datestamp}"'\"/' ${path} > ${tmp} | 20 sed 's/\(echo \"'"${nonce}"'\).*\"/\1'"${datestamp}"'\"/' ${path} > ${tmp} |
21 if [[ ! -e "${tmp}" ]] | |
22 then | |
23 echo "Temporary file creation not successful" | |
24 exit 1 | |
25 fi | |
21 | 26 |
22 # echo last and current generation times for example | 27 # echo last and current generation times for example |
23 echo "This script last generated at (None)" | 28 echo "This script last generated at (None)" |
24 echo "Now: ${datestamp}" | 29 echo "Now: ${datestamp}" |
25 | 30 |
26 # move tmpfile -> script location via exec | 31 # move tmpfile -> script location via exec |
32 exec mv ${tmp} ${path} |