我有这样的输出:

TEXT
SOMETEXTELSE


我需要合并字符串,并在它们之间添加符号“ R”,例如:

TEXT R SOMETEXTELSE


我该怎么办?

谢谢

更新。抱歉。这是命令

egrep -B1 ELLDB@сranium.*FAILED /var/log/alert.log | tail -2


这是输出:

ERR-0045 Database is down for given SID. Can't perform backup.
2014-12-19 16:15:01 ELLDB@сranium Backuper:bkp status: FAILED 98456876


我需要像这样的输出:

ERR-0045 Database is down for given SID. Can't perform backup. R 2014-12-19 16:15:01 ELLDB@сranium Backuper:bkp status: FAILED 98456876

最佳答案

sed '$! s/.*/\0 R/' | paste -s -d " "

关于linux - 将两行合并为一个并添加字符,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29437341/

10-14 18:56