gpt4 book ai didi

linux - 我如何在 shell 中使用函数编写这个

转载 作者:太空宇宙 更新时间:2023-11-04 12:04:37 25 4
gpt4 key购买 nike

<分区>

如何简化下面的脚本。

a="/mappings/file_prod_name.txt"; 

if [[ ${a,,} =~ 'dev' ]]; then
ENV="dev"
echo "Environment is $ENV "

elif [[ ${a,,} =~ 'test' ]]; then
ENV="test"
echo "Environment is $ENV "

elif [[ ${a,,} =~ 'prod' ]]; then
ENV="prod"
echo "Environment is $ENV "

else echo 'Please enter existing environment file'; fi

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com