标签:获取 pre else sleep not 开始 result ddr return
repeat() { while :; do $@ && return; sleep 10; done } echo 开始获取已经安装的插件 installed=`code --list-extensions 2>&1` echo 完成获取全部已经安装插件 tryin() { ison=$(echo "$installed" | grep $1) if [[ "$ison" != "" ]] then echo "略,早都安完了,$1" return 0 fi echo "正在试 $1" msg=`code --install-extension $1 2>&1` echo "尝试 $1 结果: $msg" result=$(echo "$msg" | grep -P "TIME.*OUT | getaddrinfo.*NOT.*FOUND") if [[ "$result" != "" ]] then echo "网不好,再试: $1" return 1 else echo "应该安装完了: $1" return 0 fi }
标签:获取 pre else sleep not 开始 result ddr return
原文地址:https://www.cnblogs.com/Searchor/p/11221168.html