当前位置: 首页> 游戏> 攻略 > 阿虎手机站_大连seo推广优化_推广方案框架_国内打开google网页的方法

阿虎手机站_大连seo推广优化_推广方案框架_国内打开google网页的方法

时间:2025/7/12 6:32:02来源:https://blog.csdn.net/LostSpeed/article/details/145582502 浏览次数:0次
阿虎手机站_大连seo推广优化_推广方案框架_国内打开google网页的方法

文章目录

    • git,bash - 例子整理
    • 概述
    • 笔记
    • 遍历目录,找到目标文件后干活
    • END

git,bash - 例子整理

概述

在git bash中的脚本和linux bash中好像差不多。
整理一些例子,为以后做参考

笔记

遍历目录,找到目标文件后干活

#!/bin/bash
# git bash 脚本 - 遍历修改当前目录下得所有 .gitmodules , 替换https 库 url 到 ssh 库 url# 前置操作 : 写好my_task.sh后,给执行权限
# chmod 777 ./my_task.sh# 前置操作 : 检查脚本的语法是否正确?
# bash -n my_task.sh
# 如果没看到输出,就说明脚本语法是正确的# 运行脚本
# 进入到脚本的目录
# ./my_task.shclear
echo "---------- my_task.sh running ----------"# echo "current user:(" $(whoami) ")"# log begin time
echo "begin : ($(date '+%Y-%m-%d %H:%M:%S'))"# =号两边不能有空格
file_cnt=0find . -type f -name ".gitmodules" -print0 | while IFS= read -r -d '' file; dodir=$(dirname "$file")(cd "$dir" || { echo "⚠️ dir switch err: $dir"; exit 1; }# echo "finding $(pwd)/.gitmodules"if [ -f "$(pwd)/.gitmodules" ]; then echo "!!! ($((file_cnt + 1))) was found $(pwd)/.gitmodules, ready to process"sed -i 's|https://github.com/|git@github.com:|g' .gitmodulesgit submodule sync --recursivefi    )file_cnt=$((file_cnt + 1))
done# log end time
echo "end   : ($(date '+%Y-%m-%d %H:%M:%S'))"

END

关键字:阿虎手机站_大连seo推广优化_推广方案框架_国内打开google网页的方法

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: