Skip to content
Advertisement

Merge two lines into one and add character

I’v got a output like:

TEXT
SOMETEXTELSE

I need to merge the strings and add symbol “R” betwen them like:

TEXT R SOMETEXTELSE

How i can do it?

Thanks

Update. Sorry. Here is the comand

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

Here is the output:

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

I need output like:

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

Advertisement

Answer

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