easy shell scripting question

I've made with the help of people here this script to filter the ssh attempts:

#!/bin/sh
cat /var/log/messages | grep "authentication failure;" | gawk -F: '{ print $4 }' > /tmp/ssh.txt
sort /tmp/ssh.txt | uniq > /tmp/sshfinal.txt
cat /tmp/sshfinal.txt | gawk -F"rhost=" '{ split($2, a, " |\r\n"); print a[1]; }' | uniq > /tmp/sshfinal.txt

i've added this line to get it via email after a cron setup.

echo -e "Subject:Firewall\nFrom:Server <senderemail\>\n"`cat /tmp/sshfinal.txt` | /usr/sbin/sendmail myemail

The sshfinal.txt file looks like this:
195.97.43.147
201.218.205.164
202.103.69.69
203.146.140.96
217.65.24.148
218.239.223.223
218.249.174.24
222.90.232.199

But ofcourse when I receive the email its like this :
195.97.43.147 201.218.205.164 202.103.69.69 203.146.140.96 217.65.24.148 218.239.223.223

it may sounds stupid but how can I change that ?

I know i could do that if i would use \n at the end of each ip in the sshfinal.txt file, but the file is generated by the script each time so I dont know how to do that.

LVL 2
MaRiOsGRAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
(echo -e "Subject:Firewall\nFrom:Server <senderemail\>\n"; cat /tmp/sshfinal.txt) | /usr/sbin/sendmail myemail

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MaRiOsGRAuthor Commented:
it was so easy? damn..

thank you veru much.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.