diff options
author | Matthias Klose <doko@ubuntu.com> | 2008-07-12 07:51:48 (GMT) |
---|---|---|
committer | Matthias Klose <doko@ubuntu.com> | 2008-07-12 07:51:48 (GMT) |
commit | 9c87a40786837062ece9b8cafb4843949853befa (patch) | |
tree | e51cf2e3b490e97da8e02a377c652bb223c9cd3e /Tools | |
parent | 873c3864bab0c457f22d1a2de15df1c6e7c041b5 (diff) | |
download | cpython-9c87a40786837062ece9b8cafb4843949853befa.zip cpython-9c87a40786837062ece9b8cafb4843949853befa.tar.gz cpython-9c87a40786837062ece9b8cafb4843949853befa.tar.bz2 |
- Fix bashisms in Tools/faqwiz/move-faqwiz.sh
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/faqwiz/move-faqwiz.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Tools/faqwiz/move-faqwiz.sh b/Tools/faqwiz/move-faqwiz.sh index 6a708aa..b3bcc92 100755 --- a/Tools/faqwiz/move-faqwiz.sh +++ b/Tools/faqwiz/move-faqwiz.sh @@ -9,7 +9,7 @@ # blackjesus:~> ./move-faqwiz.sh 2\.1 3\.2 # Moving FAQ question 02.001 to 03.002 -if [ x$2 == x ]; then +if [ x$2 = x ]; then echo "Need 2 args: original_version final_version." exit 2 fi @@ -19,7 +19,7 @@ if [ ! -d data -o ! -d data/RCS ]; then exit 2 fi -function cut_n_pad() { +cut_n_pad() { t=`echo $1 | cut -d. -f $2` export $3=`echo $t | awk "{ tmp = \\$0; l = length(tmp); for (i = 0; i < $2-l+1; i++) { tmp = "0".tmp } print tmp }"` } @@ -28,7 +28,13 @@ cut_n_pad $1 1 prefix1 cut_n_pad $1 2 suffix1 cut_n_pad $2 1 prefix2 cut_n_pad $2 2 suffix2 -tmpfile=tmp$RANDOM.tmp +if which tempfile >/dev/null; then + tmpfile=$(tempfile -d .) +elif [ -n "$RANDOM" ]; then + tmpfile=tmp$RANDOM.tmp +else + tmpfile=tmp$$.tmp +fi file1=faq$prefix1.$suffix1.htp file2=faq$prefix2.$suffix2.htp |