Linux中的bash脚本

#!/bin/bash
time=$(date "+%Y-%m-%d")
time2=$(date "+%Y-%m-%d %H:%M:%S")
file="/home/pi/RunningLogs/${time}.log"
echo "-----${time2}-----" >> $file
adb shell am broadcast -a com.android.test.TEST --es test "getRunningTime" >> $file
echo -e "-----end-----\n" >> $file

发表评论