shell使用
字符串包含判断
#!/usr/bin/env bash
gproxy() {
if [[ $1 =~ "https://github.com" ]]; then
command wget "https://ghproxy.com/$1"
else
command wget "$1"
fi
}
# 使用, gproxy()方法放到bashrc里面
gproxy https://github.com/jcleng/release_flatpak_file/releases/download/com.sublimetext.three_stable_202308300156/com.sublimetext.three_stable.flatpak
# 把文本内容替换成变量环境
envsubst < 1.txt