Linux 跨平台编译调试
把修改过的代码发送到编译的机器
#!/bin/bash if [ $# -lt 1 ] then echo "Input the destination such as root@10.4.10.78:~/src/" exit fi file_list="file_list" update_script="update.sh" svn diff | grep +++ | sed 's/(working copy)//g' | sed 's/+++ //g' > $file_list files=$(cat $file_list | tr "\n" " ") echo "Files:" cat $file_list echo "" scp $files $file_list $update_script $1
update.sh 在编译的机器上copy文件到最终位置。
#!/bin/bash update_one_file(){ dir_base=$2 full_name=$1 file_name="${full_name##*/}" dir_name="${full_name%/*}" echo "cp $file_name $dir_base$dir_name"
cp $file_name $dir_base$dir_name
} if [ $# -lt 1 ] then echo "Input the base of code directory." exit fi while read -r line; do #echo "Updating file " "$line" update_one_file $line $1 done < file_list echo "Finished."