Sed命令Unix。在每个命令后添加一行空格

时间:2014-07-09 17:04:52

标签: shell unix sed

您好我正在写一个shell脚本。在shell脚本中,我有一个使用sed命令的函数

Rewordfunction()
{
sed -i 's/The 1st Cat was/The Dog was getting pay 132  /' AnimalReportEmail
sed -i 's/The 2nd Cat was/The Dog was getting pay 232/' AnimalReportEmail
sed -i 's/The 3rd Cat was/The Dog was getting pay 2344 /' AnimalReportEmail
}

sed命令按照预期工作我希望如何实现它,所以当我发送电子邮件时它看起来像这样

The Dog was getting pay 132
The Dog was getting pay 232
The Dog was getting pay 2344 

而不是这个

The Dog was getting pay 132 The Dog was getting pay 232 The Dog was getting pay 2344

有没有办法在每个命令后添加一行空格,这样我才能得到我想要的结果?先感谢您。

0 个答案:

没有答案