pa的所有文件中的 i<100 替换成i<2 :
sed -i "" 's/i<100/i<2/g' `grep "i<100" -rl ./pa-*`
所有的文件中的lockForDuration(10)改为3:
sed -i "" 's/lockForDuration(10)/lockForDuration(3)/g' `grep "lockForDuration(10)" -rl ./`
把window.scrollViews()[0].buttons()[2].tap()替换为window.collectionViews()[0].cells()["icon"].buttons()[0].tap();
man sed
sed -i "" -E "s/window\.scrollViews\(\)\[0\]\.buttons\(\)\[2\]\.tap\(\)/window.collectionViews()[0].cells()["icon"].buttons()[0].tap()/" `egrep "window\.scrollViews\(\)\[0\]\.buttons\(\)\[2\]\.tap\(\)" -rl ./`
window.buttons()[0].tap()修改为app.tabBar().buttons()[0].tap();
sed -i "" -E "s/window\.buttons\(\)\[0\].tap()/app.tabBar().buttons()[0].tap()/g" `egrep "window.buttons\(\)\[0\].tap\(\)" -rl ./`
常用命令:
cp *.xml report/
find ./ -name "*.xml" -exec cp {} report/ \;
find ./ -name "*.xml" | grep "1.xml"
zip -r report.zip report
zip report.zip *.xml
远程命令:
ssh username@ip"cd /;ls -l"
上传下载命令
scp username@ip:/Users/xuchuang/Desktop/tests_1/report.zip /Users/cienet/Desktop/
scp username@ip:/Users/zhaoze/Desktop/Microsoft* ~/Desktop/
进程
ps -ef|grep sshd
查看脚本的执行的时间:
export HISTTIMEFORMAT="%F %T `whoami` "
history|more