Operating System - HP-UX
1825012 Members
4627 Online
109678 Solutions
New Discussion юеВ

mal command ...contetnts format in the email

 
SOLVED
Go to solution
Manuales
Super Advisor

mal command ...contetnts format in the email

Hi ...
how can i separate lines in the contents of each mail i send, i mean if i put:

$mail_alert contents:
Patito
Gatito
Librito
Lapicito
mailsito
botellita

mailx -s "Alert" $mail_ < $HOME/$scripts/$mail_alert

the mail arrive with next format:
Patito Gatito Librito Lapicito mailsito botellita

how do i must to do for the mail arrive like next:
Patito
Gatito
Librito
Lapicito
mailsito
botellita

Thanks,Manuales.
6 REPLIES 6
David Bellamy
Respected Contributor
Solution

Re: mal command ...contetnts format in the email

Manuales i assume that the names in the $mail_alert file are the users that you want to sent an alert to. if this is the case you need to setup an alias group file and put the names in it. here are the steps.
1. edit the aliases file in /etc/mail and add an entry like the following:
mailusers::include:/home/xxxx/mailusers.
2. create mailusers file and add names.
3. Run newaliases command.
Sandman!
Honored Contributor

Re: mal command ...contetnts format in the email

Manuales,

Run ux2dos utility and send it using mailx...something like:

# echo $mail_alert | ux2dos | mailx -s "Alert" $mail_

cheers!
Ivan Ferreira
Honored Contributor

Re: mal command ...contetnts format in the email

I have tested on my system and the file format arrives correctly. How do you generate the $mail_alert file? Have you tried with another mail client program?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Geoff Wild
Honored Contributor

Re: mal command ...contetnts format in the email

I think it is how you are generating/reading the file - IE setting the $mail_alert

If you just input redirect the file - it should work:

# cat /home/gwild/alert
Patito
Gatito
Librito
Lapicito
mailsito
botellita


mailx -s "Alert" gwild@mydomain.com
Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Arturo Galbiati
Esteemed Contributor

Re: mal command ...contetnts format in the email

hi,
mailx -s "Alert" $mail_ <Patito
Gatito
Librito
Lapicito
mailsito
botellita
END_OF_DATA

HTH,
Art
RAC_1
Honored Contributor

Re: mal command ...contetnts format in the email

od -c $HOME/$scripts/$mail_alert

Hoe does it look??
There is no substitute to HARDWORK