shell script

1.写文件: 

echo "内容" >> "$path/log.txt"

2.判断文件是否存在

if [ ! -e "$CODE_PATH" ]; 

then

else

fi

3.取时间 (http://www.cnblogs.com/mfryf/archive/2012/03/23/2413362.html

echo $(date +%Y-%m-%d%t%H:%M:%S) 

4.删除目录:(http://www.runoob.com/linux/linux-comm-rmdir.html

rmdir 

5.执行Mac app内脚本

"/Applications/Cocos/Cocos Studio 2.app/Contents/MacOS/Cocos.Tool" publish -a -f "$CODE_PROJECT/WangWangParkour.ccs" -o "$CODE_PROJECT/res" >> "$LOG_PATH/makeAPK_log.txt"

6.shell 脚本中执行其它sh

cd "$CYGWIN_PACK_FILES_PATH"
chmod a+x pack_files.sh
./pack_files.sh -i $CODE_PROJECT/res -o $CODE_PROJECT/restemp -ek $MyLuaKey -es $MyLuaSign

7.拷贝(http://blog.csdn.net/yf210yf/article/details/9207335

cp -R "$CODE_PROJECT/restemp"  "$CODE_PROJECT/resluc" 

posted on 2015-12-08 20:07  kelisi_king  阅读(167)  评论(0编辑  收藏  举报