Changeset 137 for trunk/Platforms/Test/script/copy_test.sh
- Timestamp:
- Feb 16, 2010, 1:35:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Platforms/Test/script/copy_test.sh
r117 r137 7 7 } 8 8 9 if test ${#} -eq 2; then 10 name_src=${1}; 11 name_dest=${2}; 12 elif test ${#} -eq 1; then 13 name_src="x1_w1_0"; 14 name_dest=${1}; 15 else 16 usage ${*}; 17 fi; 9 function copy_test () 10 { 11 # Test usage 12 if test ${#} -eq 2; then 13 name_src=${1}; 14 name_dest=${2}; 15 elif test ${#} -eq 1; then 16 name_src="x1_w1_0"; 17 name_dest=${1}; 18 else 19 usage ${*}; 20 fi; 21 22 # Test directory source 23 if test ! -d ${name_src}; then 24 echo "${name_src} is an invalid directory"; 25 exit; 26 fi; 27 28 # Test directoru dest : if don't exist, create it 29 if test ! -d ${name_dest}; then 30 mkdir ${name_dest}; 31 fi; 32 33 # Copy and sed 34 for i in ${name_src}/*; do 35 sed s/Instance_${name_src}/Instance_${name_dest}/ ${i} > tmp; 36 mv tmp ${name_dest}/$(basename ${i}); 37 done 38 } 18 39 19 if test ! -d ${name_src}; then 20 echo "${name_src} is an invalid directory"; 21 exit; 22 fi; 23 24 if test ! -d ${name_dest}; then 25 mkdir ${name_dest}; 26 fi; 27 28 for i in ${name_src}/*; do 29 sed s/Instance_${name_src}/Instance_${name_dest}/ ${i} > tmp; 30 mv tmp ${name_dest}/$(basename ${i}); 31 done 40 copy_test ${*}
Note: See TracChangeset
for help on using the changeset viewer.