#!/bin/ksh
LOG_DATE=`date +%Y%m`
export LOG_DATE
cd D:/Informatica/Informatica_share/SrcFiles/l
# mv SITE_ACTIVITY${LOG_DATE}.CSV D:/Informatica/Informatica_share/SrcFiles/SITE_ACTIVITY${LOG_DATE} .CSV
# mv SITE_ACTIVITY20050914114546.CSV D:/Informatica/Informatica_share/SrcFiles/SITE_ACTIVITY20050914114546.CSV
mv SITE_ACTIVITY${LOG_DATE}.CSV D:/Informatica/Informatica_share/SrcFiles/SITE_ACTIVITY${LOG_DATE} '.CSV'
ftp -inv <<EOF
open xyz.eng.abc.com
user hik klm
cd /opt/edocs/AV
# mget SITE_ACTIVITY${LOG_DATE}.CSV
mget SITE_ACTIVITY${LOG_DATE}*.
# mget SITE_ACTIVITY20050914114546.CSV
bye
EOF
My question is when I run the script with the file name specified in mget command it is able to FTP the file from unix to NT
If I substitute the variable in the file for the mget command it dosent ftp the file
I am invoking this script in Informatica
Please help me if any thing wrong in the script
Thank you
---vivek
have you looked into what 'date +%Y%m' actually returns and compared that against your file naming convention?
I get 200509
Thats what I need
Thank you
---vivek
D:/Informatica/Informatica_share/SrcFiles/SITE_ACTIVITY20050914114546.CSV
hmm.........
But in the code I have
mget SITE_ACTIVITY$LOG_DATE*.CSV
This should work right
it should return SITE_ACTIVITY20050914114546.CSV right
But It not getting the value
when I substitute whole file name then It recognizes
please help me
Thank you
---vivek
dangral
September 15, 2005, 11:43am
6
vivekanandarpat:
But in the code I have
mget SITE_ACTIVITY$LOG_DATE*.CSV
This should work right
it should return SITE_ACTIVITY20050914114546.CSV right
But It not getting the value
when I substitute whole file name then It recognizes
please help me
Thank you
---vivek
try
mget SITE_ACTIVITY${LOG_DATE}*.CSV
Ok
do you have any Idea
can you write the code to ftp file from unix system to NT system
using variable substition
I can customize it
Thank you
Thank you