Mercurial > hg > config
diff bin/example/self-writing.sh @ 327:59f402cd9d98
get mode dynamically
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 08 Jun 2013 08:51:52 -0700 |
parents | dbb6ef0c9a26 |
children | 5de727eb5dc0 |
line wrap: on
line diff
--- 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 "