大家好,我新学SHELL在这向大家请教个问题:
比如说我有个名字叫FILE的文件,它里面的内容如下:
This is a test line1
This is a test line2
This is a test line3
This is a test line4
This is a test line5
This is a test line6
我现在想把FILE文件里的每行整行都赋值给line这个变量
我写了如下命令:
for line in `cat FILE`
do
echo $line
done
exit
可是执行了之后却是显示每个单词为一行,请问要怎么赋值????
This
is
a
test
line1
This
is
a
test
line2
This
is
a
test
line3
This
is
a
test
line4
This
is
a
test
line5
This
is
a
test
line6
[问题]如何将句子赋值给一个变量!
-
- 帖子: 45
- 注册时间: 2008-03-22 1:19
- 联系:
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
-
- 帖子: 45
- 注册时间: 2008-03-22 1:19
- 联系:
-
- 帖子: 45
- 注册时间: 2008-03-22 1:19
- 联系: