第乙個Shell指令碼 lint檢查以及報告收集

2022-04-08 14:25:06 字數 893 閱讀 9431

在不需要開發修改android專案配置檔案的情況下,執行android lint檢查,檢查完後,將各個aar包下的檢查結果從遠端機器copy到節點機器上來。

#!/bin/sh

#用於android lint檢查專案中,將構建任務中的lint檔案copy到當前job中

#從pmo機器中將所有的build檔案儲存到本地機器上來

#lint檔案所在的根目錄

work_dir=$1

#需要移動到目標目錄

target_dir=$2

echo "lint源目錄 : "+$work_dir

echo "lint將要移動到的目錄 : "+$target_dir

echo "*************************===start**********==="

# 清空結果目錄

delete_report_dir()

echo "***************=delete_report_dir_end**********=="

#移動檔案到報告目錄

move_dir_lint_file()" =~ "lint-results" ]];then

dir_file=$target_dir/report/$

# echo "目標存放目錄"+$dir_file

# echo "目標檔案:" + $i

mkdir -p $dir_file

cp -rf $i $dir_file

fidone

}echo "***************=move_dir_lint_file**********=="

list_alldir()

echo "***************=list_alldir_end**********=="

第乙個Shell指令碼

開啟文字編輯器,新建乙個檔案,擴充套件名為sh sh代表shell 副檔名並不影響指令碼執行,見名知意就好,如果你用php寫shell 指令碼,副檔名就用php好了。輸入一些 bin bash echo hello world 是乙個約定的標記,它告訴系統這個指令碼需要什麼直譯器來執行,即使用哪一種...

第乙個shell指令碼

首先宣告,我的linux系統是centeros 64bit的 開啟終端,cd mnt hgfs share 進入以下目錄 mkdir shellfolder 建立資料夾shellfolder touch runstusys.sh 建立乙個shell程式 vi runstusys.sh 進行編輯,並輸...

第乙個shell指令碼

hostname term hello shell histsize ssh client world cvs rsh path 通過shell讀取文字檔案,並到系統變數中查詢是否存在 shell命令如下 bin sh filename env var.txt num cat filename wc...