美文网首页
常用shell脚本

常用shell脚本

作者: 幸运星32 | 来源:发表于2020-04-20 17:24 被阅读0次

-d 文件夹---- 判断文件夹是否存在
-f 文件 ----- 判断文件是否存在
echo "" ------输入日志
mkdir “” --------创建文件夹
rm 文件名称 --------删除文件
rm -rf 文件夹 --------删除文件夹
curl -u {username}:{password} {remoteJarPath} -o 输出目录 --------从远程服务器下载文件

下载文件
curl -u ${username}:${password} ${remoteJarPath} -o "${libsPath}sdk-Release-v${sdkVersion}.jar"
上传文件到服务器
scp -r build/*.jar ${remoteServer}${remotePath}${aarDownloadPath}
定义一个函数
function  add(){

}
条件判断
if [ -d fileName ]; then
    echo "文件存在"
else
    echo "文件不存在,准备创建一个"
    mkdir "fileName"
fi

相关文章

网友评论

      本文标题:常用shell脚本

      本文链接:https://www.haomeiwen.com/subject/siqrihtx.html