Linux下将txt的内容存储为变量

有a.txt,其中的内容为:

a.txt:

1  2  4

3  5  4 

2  7  6

将a.txt中的内容存储为变量a,使用如下命令:

a=$(cat a.txt)

调用变量a时,使用$a即可。

猜你喜欢

转载自blog.csdn.net/qq_36480087/article/details/86302283