RE: Export data in order to use it as a variable in shell
Posted in 2000
How about something like the following (I use it all the time)
#!/usr/bin/ksh
[your code here]
for i in `cat report.txt`
do
mailx -s "Report" $i@host < report.txt
done
-----Original Message-----
From: Ilhan Erden [mailto:ilerden@ea-dc.dhl.com]
Sent: Wednesday, November 22, 2000 4:32 AM
Posted To: informix
Conversation: Export data in order to use it as a variable in shell
Subject: Export data in order to use it as a variable in shell
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