Re: Using mailx
Posted in 2000
--- "Ilhan Erden" <ilerden@ea-dc.dhl.com> > wrote: >Hi > >I'm trying to use mailx command within a cron script but it doesn't >work. >The script grabs the e-mail address field from the "weekly_check" >file >(8 th field) and moves it to the variable "kod". >After that it should run mailx to the receiver "kod". > >if [ -s "/home/it/hq/internet/weekly_check" ] > then > for X in /home/it/hq/internet/weekly_check > do > kod=cat | cut -d"|" -f8 /home/it/hq/internet/weekly_check > mailx -s "Internet Weekly Warning Report $(date "+%d/%m/%y >%H:%M") " $kod@forex.com < >/home/it/hq/internet/formatted_int_report.txt > done >fi > >Here is a sample : > >weekly_check file : > >746|YKK METAL PLAST'K|FETE|THASU|80065|x|FBAKYKK|W06|23/03/2000| >862|OTOMOT YA |NLIK|CAESF|22356|e|eraf34d|BS2|31/03/2000| > ^ > This field is the >kod. >The Shell output is this : >W06 >BS2 >@forex.com... user address required > >It seems that it doesn't recognise the e-mail address. > >Cheers Your for loop should grab the email addresses one at a time from the weekly_check file. Try something more like: for kod in `cat weekly_check | awk -F| '{print $8}'` do your mailx command with $kod in it Note the grave accents before cat and after the awk == "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next. _____________________________________________________________ Want a new web-based email account ? ---> http://www.firstlinux.net