I am trying to load data into 3 tables simultaneously (which is working fine). Then when loaded, it should count the total number of records in all the 3 input files and send an e-mail to the user.
The script is working fine, as far as loading all the 3 input files into the database tables, but i am not able to send e-mail.
Appreciate any help, with the script.
************************
The shell script is:
/usr/local/pl/util_scripts/perlencrypt.pl -k /export/home/oracle/secure/ealgorithm -d /sdr1/system/$pwd_file | sqlldr $userName control=/space/dbexport/
PHR/control/condition.ctl log=/space/dbexport/PHR/log/condition-`date +%Y%m%d`.log bad=/space/dbexport/PHR/bad/condition-`date +%Y%m%d`.bad
/usr/local/pl/util_scripts/perlencrypt.pl -k /export/home/oracle/secure/ealgorithm -d /sdr1/system/$pwd_file | sqlldr $userName control=/space/dbexport/
PHR/control/encounter.ctl log=/space/dbexport/PHR/log/encounter-`date +%Y%m%d`.log bad=/space/dbexport/PHR/bad/encounter-`date +%Y%m%d`.bad
/usr/local/pl/util_scripts/perlencrypt.pl -k /export/home/oracle/secure/ealgorithm -d /sdr1/system/$pwd_file | sqlldr $userName control=/space/dbexport/
PHR/control/procedure.ctl log=/space/dbexport/PHR/log/procedure-`date +%Y%m%d`.log bad=/space/dbexport/PHR/bad/procedure-`date +%Y%m%d`.bad
( echo 'CONDITION, ENCOUNTER & PROCEDURE LOAD PROCESS FINISHED SUCCESSFULLY', The total records loaded into the tables are:
$( wc -l < /space/dbexport/PHR/data/conditionExport_test.csv),
$( wc -l < /space/dbexport/PHR/data/encounterExport.csv),
$( wc -l < /space/dbexport/PHR/data/procedureExport.csv) $logfile $basename ) | mailx -s "$subject" "$to" msrblr@gmail.com
The error that i am getting is:
./sqlldrclaims_test1.sh[44]: 2000,: not found
./sqlldrclaims_test1.sh[45]: 10000,: not found
./sqlldrclaims_test1.sh[46]: 10000: not found