# HG changeset patch # User Jeff Hammel # Date 1370706712 25200 # Node ID 59f402cd9d982681682f3129b53c58cb1de541a2 # Parent dbb6ef0c9a264459c22c987831fda49f800536fd get mode dynamically diff -r dbb6ef0c9a26 -r 59f402cd9d98 bin/example/self-writing.sh --- a/bin/example/self-writing.sh Sat Jun 08 08:48:26 2013 -0700 +++ b/bin/example/self-writing.sh Sat Jun 08 08:51:52 2013 -0700 @@ -5,7 +5,8 @@ # Other solutions (magic markers, etc) are possible path=`readlink -f $0` -tmp=`tempfile --mode 0755` +mode=`stat --format '%a' ${path}` +tmp=`tempfile --mode ${mode}` datestamp=`date` nonce="This script last generated at "