【发布时间】:2015-06-25 01:01:28
【问题描述】:
有没有一种简单的方法可以将多个变量写入一个文件,然后再读取它们?
例如将下一个变量写入文件:
test=1
b=3
a=earth
echo "test=1" > variables.prop
echo "b=3" >> variables.prop
echo "a=earth" >> variables.prop
并以某种方式返回指定变量的值并使用它。 喜欢
*command to import the variable "test" from the text file*
echo $test
*command to import the variable "b" from the text file*
echo $b
“test”的预期输出应该是“1”,“b”应该是“3”。
【问题讨论】:
标签: bash file variables command sh