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

 

相关文章:

  • 2021-06-29
  • 2022-01-20
  • 2021-07-25
  • 2021-10-20
  • 2021-10-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
  • 2021-10-17
  • 2021-07-13
  • 2021-08-26
相关资源
相似解决方案