Home » SQL & PL/SQL » SQL & PL/SQL » SCRIPT SHELL How send some files in the same mail??
SCRIPT SHELL How send some files in the same mail?? [message #220720] Wed, 21 February 2007 13:12 Go to next message
tico
Messages: 7
Registered: February 2007
Location: MEXICO
Junior Member
I'm sendin a mail with a especific file usin script shell, but i need to send more files in the same mail, i'm usin the next script shell actually, How send some files in the same mail

#!/usr/bin/ksh
##############################################################################
#
# Name : WSHDOCPRINT.prog
# Created By : Luis Enrique Gonzalez Fraga
# Created Date : 25-Oct-2006
# Purpose : Este proceso, envía la salida de los Documentos Embarques
# a impresora de acuerdo a los parametros especificados.
#
##############################################################################
#
# Standard and User Defined parameters

FCP_LOGIN=$1; export FCP_LOGIN
FCP_USERID=$2; export FCP_USERID
FCP_USERNAME=$3; export FCP_USERNAME
FCP_REQID=$4; export FCP_REQID

FCP_PRINTER=$5; export FCP_PRINTER
FCP_FILENAME=$6; export FCP_FILENAME
FCP_NUM_COP=$7; export FCP_NUM_COP

echo "Program Name: WSHDOCPRINT"
echo "Execution Start Time: " `date`
echo "PARAMETERS: $FCP_LOGIN $FCP_USERID $FCP_USERNAME $FCP_REQID $FCP_PRINTER $FCP_FILENAME $FCP_NUM_COP"
##############################################################################
# Definir la direccion de e-mail.
# En esta sección el codigo se posiciona en el directorio en donde el cuerpo
# del reporte reside y se verifica si existe alguna direccion de e-mail
##############################################################################

cd $APPLCSF/$APPLOUT
echo "$APPLCSF/$APPLOUT"

if [[ $FCP_PRINTER = '' ]] then
echo "No printer Setup"
echo "Unable to send the file to print, please review either the printer setup or check with the system administrator."
exit 2
fi
##############################################################################
# Definir si la salida del reporte existe.
# En esta sección se verifica si existe una salida a enviar, si es asi se
# procede a enviar el email, de otra manera el programa termina.
##############################################################################
if [[ ! -a o$FCP_FILENAME.out ]]
then
echo "File Not Found: o$FCP_FILENAME.out"
echo "Output file was not generated, file to print will be not sent."
exit 0
fi
##############################################################################
# Enviar el E-mail.
# En esta sección se envia el ARCHIVO A IMPRESORA, si el proceso no puede ser ejecutado se
# envia un error.
##############################################################################
#cp o$FCP_FILENAME.out o$FCP_FILENAME.pdf
lp o$FCP_FILENAME.pdf -c -d $FCP_PRINTER -n$FCP_NUM_COP
if (( $? != 0 ))
then
echo "Unable to print the file, please review either the printer setup or check with the system administrator."
exit 2
fi
echo "File Printed!"

THANKS N REGARDS
Re: SCRIPT SHELL How send some files in the same mail?? [message #220724 is a reply to message #220720] Wed, 21 February 2007 14:10 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
What does this post have to do with Oracle Or PL/SQL????
Re: SCRIPT SHELL How send some files in the same mail?? [message #220733 is a reply to message #220724] Wed, 21 February 2007 16:43 Go to previous messageGo to next message
tico
Messages: 7
Registered: February 2007
Location: MEXICO
Junior Member
THE SHELL HAVE TO READ A PATH AND REVEW IF HAVE MORE THAN I FILE AND SEND THE FILES THAT THIS PATH HAVE AND SEND IN THE SAME MAIL, IT RUNS SINCE PL/SQL

thanks regards
Re: SCRIPT SHELL How send some files in the same mail?? [message #220740 is a reply to message #220733] Wed, 21 February 2007 19:00 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member

http://www.orafaq.com/scripts/unix/sendmail.txt
http://www.orafaq.com/scripts/unix/mailx.txt

Previous Topic: Run script in OEM
Next Topic: sql help
Goto Forum:
  


Current Time: Wed Dec 04 18:43:06 CST 2024