default.yaml
{default_baseurl: ‘http://10.113.10.68:8082‘}
test.sh
a=`cat default.yaml` t=":" index=`awk -v a="$a" -v b=":" ‘BEGIN{print index(a,b)}‘` diff=${#a}-$index-2 let index=index+1 default_url=`echo ${a:$index:$diff}|sed $‘s/\‘//g‘` echo $default_url
输出
bogon:conf macname$ ./test.sh http://10.113.10.68:8082
参考:
https://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.html
原文地址:https://www.cnblogs.com/sea-stream/p/11403153.html
时间: 2024-10-13 00:45:26