我是shell scripting
的新手。我需要读取一个文件,该文件可以在所有定义了变量的shell中运行。喜欢的东西:Shell脚本按行读取文件
variable1=test1
variable2=test2
....
我必须逐行读取该文件中的行,并准备用空格隔开,像新的字符串:
variable=variable1=test1 variable2=test2 ....
我用下面的代码尝试:
while read LINE
do
$VAR="$VAR $LINE"
done < test.dat
但它扔我这个错误:
command not found Test.sh: line 3: = variable1=test1