Re: Antw: Re: Export data in order to use it as a variable inshell
Posted in 2000
How about:
for sales_code in `$INFORMIXDIR/bin/dbaccess account 2>/dev/null <<!
SELECT sales_code
FROM account!`
do
mailx -s "Report" $sales_code@host < report_file
done
The others appear to be sending the results of your sales_code query as the message body and I thought you only wanted the results of that query to populate your email address.
--- "Martin Fey" <Martin.Fey@bluvo.de>
> wrote:
>Hi,
>
>perhaps this helps:
>
>
>$INFORMIXDIR/bin/dbaccess account 2>/dev/null 1>&2 <<!
> unload to report.txt
> SELECT sales_code
> FROM account>!
>
>while read text
>do
> mailx -s "Report" $text@host
>done < report.txt
>
>
>Martin
>
>
>
>>>> Brett Geer <brett@brabys.co.za> 22.11.00 14:25 >>>
>Not so simple I'm afraid, can you give us some more detail as to
>your requirements, sure I could slap something together
>
>brett
>
>Ilhan Erden wrote:
>>
>> Hi Gurus
>>
>> I have a new challenge.
>> There is a sales_code data field in the database which includes
>> data which again I want to use as a variable in the e-mail address.
>>
>> The script should be something like :
>> ---------------------------------------------------------
>> $INFORMIXDIR/bin/dbaccess account 2>/dev/null 1>&2 <<!
>> unload to report.txt
>> SELECT sales_code
>> FROM account>> !
>> mailx -s "Report" sales_code@host < report.txt
>> ---------------------------------------------------------
>>
>> Thanks in advance...
>>
>> Ilhan Erden
>
>--
>
>-----------------------------------------------------------------
> Brett's ninth law of UNIX administration...
> Ye shall read the words:
> http://cm.bell-labs.com/who/ken/index.html
> http://cm.bell-labs.com/who/dmr/index.html
>-----------------------------------------------------------------
>Brett Geer - UNIX Admin/Analyst/Programmer - Intratex Holdings.
>Tel. +27 31 717 4000 Direct. +27 31 717 4146
>Fax. +27 31 717 4001
>-----------------------------------------------------------------
> If you have any trouble sounding condescending,
> find a Unix user to show you how it's done.
> --Scott Adams
>-----------------------------------------------------------------
==
"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