【发布时间】:2011-10-24 12:23:51
【问题描述】:
如何使用 BASH 在名为 myconfig.conf 的文件中写入多行?
#!/bin/bash
kernel="2.6.39";
distro="xyz";
echo <<< EOL
line 1, ${kernel}
line 2,
line 3, ${distro}
line 4
line ...
EOL >> /etc/myconfig.conf;
cat /etc/myconfig.conf;
【问题讨论】: