我有一个属性文件 test.properties
其内容如下:
x.T1 = 125
y.T2 = 256
z.T3 = 351
如何分配 y.T2
的值( 256
) 到 shell 脚本中的某个变量并回显这个值?
最佳答案
检查这一点,将有助于准确:
expVal=`cat test.properties | grep "y.T2" | cut -d'=' -f2`
关于shell - 如何从 Shell 脚本的属性文件中获取变量值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29230937/