Changeset 2435 for LMDZ5/branches/testing/tools
- Timestamp:
- Jan 28, 2016, 5:02:13 PM (9 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 2397-2403,2405-2407,2410-2413,2415-2424,2426-2429,2431-2432,2434
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/tools/compare_real.py
r2160 r2435 1 #!/usr/bin/env python 1 """This script should be called by "diffdef.sh". It operates on 2 different lines with common variables. It requires version 2.7 or 3 higher of Python (it also works with Python 3). 2 4 3 # Author: Lionel GUEZ 4 5 # This script should be called by "diffdef.sh". It operates on 6 # different lines with common variables. It requires version 2.7 or 7 # higher of Python (it also works with Python 3). 5 Author: Lionel GUEZ""" 8 6 9 7 import sys, os.path -
LMDZ5/branches/testing/tools/diffdef.sh
r2160 r2435 2 2 # Author: Lionel GUEZ 3 3 4 # This script compares files "*.def" other than "traceur.def" and 5 # "out.def" in two directories. The script uses GNU versions of the 6 # utilities cut, sort and uniq. 4 # This script compares files "*.def" other than "*traceur.def" and 5 # "out.def" in two directories. 6 7 # This script uses GNU versions of the utilities cut, sort and uniq, 8 # and calls a Python script. 7 9 8 10 # See guide: … … 18 20 19 21 ##set -x 22 23 type python3 >/dev/null 2>&1 24 if (($? == 0)) 25 then 26 my_python=python3 27 else 28 my_python=python 29 fi 30 20 31 set -e 21 32 … … 33 44 rm -f all.def 34 45 echo "def files in $my_directory:" 35 ls !( traceur|out).def46 ls !(*traceur|out).def 36 47 37 48 # Concatenate and format the def files: 38 cat !(traceur|out).def | tr -d " " | grep -v -E '(^#|^!|INCLUDEDEF|^$)' \ 49 cat !(*traceur|out).def | tr '\r' '\n' | tr -d " " \ 50 | grep -v -E '(^#|^!|INCLUDEDEF|^$)' \ 39 51 | tr '[:lower:]' '[:upper:]' | sed 's/=[NF]$/=FALSE/' \ 40 52 | sed 's/=[YT]$/=TRUE/' | sort >all.def … … 51 63 cat plouf_$$ 52 64 rm plouf_$$ 65 rm all.def 53 66 exit 1 54 67 fi … … 81 94 done 82 95 83 $ script_dir/compare_real.py $*96 $my_python $script_dir/compare_real.py $* 84 97 sort common_lines --output=common_lines # was modified by the Python script 85 98 echo "Created files \"./common_lines\" and \"./uniq_val\"."
Note: See TracChangeset
for help on using the changeset viewer.