LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Run fast export with passing parameters through ksh (https://www.linuxquestions.org/questions/linux-newbie-8/run-fast-export-with-passing-parameters-through-ksh-4175489270/)

renuk 12-27-2013 02:37 AM

Run fast export with passing parameters through ksh
 
Hi,

i am trying to run .fe through ksh with parameter UNPROCESS/UNREGISTERED
but it is giving me error

PHP Code:

[B]if [ `$param` == "UNPROCESS" ]; then[/B]
cat ${DSADM_ROOT}/$senv/sql/GLMA_DW_FILE_EXPORT_TEMPLATE.fe|sed "s%{--}% %g"|sed "s%{TD_ABAC_DBNAME}%$TD_ABAC_DBNAME%g"|sed "s%{TD_ABAC_DBUSER}%$TD_ABAC_DBUSER%g"|sed "s%{TD_ABAC_DBPASS}%$TD_ABAC_DBPASS%g"|sed "s%{DSADM_ROOT}%$DSADM_ROOT%g"|sed "s%{senv}%$senv%g"|sed "s%{POLARIS_POS_LANDING_DIR}%$POLARIS_POS_LANDING_DIR%g"|sed "s%{TD_ABAC_LOGSCHEMA}%$TD_ABAC_LOGSCHEMA%g"|sed "s%{TD_ABAC_DBVIEW}%$TD_ABAC_DBVIEW%g"|sed "s%{JOB_SERIAL_NO}%${JOB_SERIAL_NO}%g" > ${POLARIS_POS_LANDING_DIR}/GLMA_DW_FILE_EXPORT_TEMPLATE_${JOB_SERIAL_NO}.fe
[B]elif [ `$param` == "UNREGISTERED" ]; then[/B]
cat ${DSADM_ROOT}/$senv/sql/GLMA_DW_FILE_EXPORT_TEMPLATE.fe|sed "s%{--}%--%g"|sed "s%{TD_ABAC_DBNAME}%$TD_ABAC_DBNAME%g"|sed "s%{TD_ABAC_DBUSER}%$TD_ABAC_DBUSER%g"|sed "s%{TD_ABAC_DBPASS}%$TD_ABAC_DBPASS%g"|sed "s%{DSADM_ROOT}%$DSADM_ROOT%g"|sed "s%{senv}%$senv%g"|sed "s%{POLARIS_POS_LANDING_DIR}%$POLARIS_POS_LANDING_DIR%g"|sed "s%{TD_ABAC_LOGSCHEMA}%$TD_ABAC_LOGSCHEMA%g"|sed "s%{TD_ABAC_DBVIEW}%$TD_ABAC_DBVIEW%g"|sed "s%{JOB_SERIAL_NO}%${JOB_SERIAL_NO}%g" > ${POLARIS_POS_LANDING_DIR}/GLMA_DW_FILE_EXPORT_TEMPLATE_${JOB_SERIAL_NO}.fe
fi


below is the query of .fe

SELECT DW_FILE_NA
FROM {TD_ABAC_DBVIEW}.V1DW_FILE
WHERE DW_DATA_TYP_ID IN (1,2,3,39,40,41,42,43,45,46,47,48)
AND FILE_DW_ARRV_TS > (current_date -5)
{--} AND DW_DATA_TYP_ID IN (10,11);
thanks!!

druuna 12-27-2013 03:11 AM

Which error?

This doesn't seem correct:
Code:

if [ `$param` == "UNPROCESS" ]; then
$param should be between double quotes and not backticks.
Code:

if [ "$param" == "UNPROCESS" ]; then

divyashree 12-27-2013 04:02 AM

What error you are getting ??

Also run this in your terminal directly:

Quote:

cat ${DSADM_ROOT}/$senv/sql/GLMA_DW_FILE_EXPORT_TEMPLATE.fe
Is it giving you the correct content of that file ?

renuk 12-27-2013 04:02 AM

Thanks!!
Below was write one
if [ "$param" == "UNPROCESS" ]; then

druuna 12-27-2013 04:05 AM

Quote:

Originally Posted by renuk (Post 5087526)
Thanks

You're welcome.

BTW: Can you put up the [SOLVED] tag.
- above the first post -> Please Mark this thread as solved if you feel a solution has been provided.
- -or- -
- first post -> Thread Tools -> Mark this thread as solved


All times are GMT -5. The time now is 12:00 PM.