portabilite de script sed

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7732 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Damien Doligez 2006-11-15 14:49:26 +00:00
parent 7e7ce6e349
commit db85ff05ef
1 changed files with 2 additions and 2 deletions

View File

@ -5,14 +5,14 @@ MAX_SAVE = 10
backup:
cp camlp4boot camlp4boot.save.0
set -e; for i in camlp4boot.save.*; do \
mv $$i camlp4boot.evas.$$((`echo $$i | sed -e 's/.*\.save\.\([0-9]\+\)/\1/'` + 1)); \
mv $$i camlp4boot.evas.$$((`echo $$i | sed -e 's/.*\.save\.\([0-9][0-9]*\)/\1/'` + 1)); \
done
set -e; for i in camlp4boot.evas.*; do mv $$i $${i/.evas./.save.}; done
rm -f camlp4boot.save.$(MAX_SAVE)
restore:
set -e; for i in camlp4boot.save.*; do \
mv $$i camlp4boot.evas.$$((`echo $$i | sed -e 's/.*\.save\.\([0-9]\+\)/\1/'` - 1)); \
mv $$i camlp4boot.evas.$$((`echo $$i | sed -e 's/.*\.save\.\([0-9][0-9]*\)/\1/'` - 1)); \
done
set -e; for i in camlp4boot.evas.*; do mv $$i $${i/.evas./.save.}; done
mv camlp4boot.save.0 camlp4boot