The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can any body tell me. sackNumchai Linux 3 05-05-2008 09:28 PM
can any body give some idea on this.. sapan123 UNIX for Advanced & Expert Users 1 10-21-2007 09:10 AM
how i prepare a c++ code(c code) for implementing my own protocol format amitpansuria High Level Programming 1 09-06-2007 08:09 PM
can any body correct the code vivekanandarpat UNIX for Advanced & Expert Users 2 09-16-2005 06:24 AM
How to get åäö in e-mail message body de98luto UNIX for Dummies Questions & Answers 4 07-10-2002 02:35 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-14-2005
Registered User
 

Join Date: Apr 2005
Posts: 6
Stumble this Post!
Smile Can any body correct the code

#!/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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-14-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,002
Stumble this Post!
have you looked into what 'date +%Y%m' actually returns and compared that against your file naming convention?
Reply With Quote
  #3 (permalink)  
Old 09-15-2005
Registered User
 

Join Date: Apr 2005
Posts: 6
Stumble this Post!
I get 200509
Thats what I need

Thank you
---vivek
Reply With Quote
  #4 (permalink)  
Old 09-15-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,002
Stumble this Post!
Quote:
Originally Posted by vivekanandarpat
I get 200509
Thats what I need

Thank you
---vivek
Code:
D:/Informatica/Informatica_share/SrcFiles/SITE_ACTIVITY20050914114546.CSV
hmm.........
Reply With Quote
  #5 (permalink)  
Old 09-15-2005
Registered User
 

Join Date: Apr 2005
Posts: 6
Stumble this Post!
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
Reply With Quote
  #6 (permalink)  
Old 09-15-2005
Registered User
 

Join Date: Oct 2002
Posts: 670
Stumble this Post!
Quote:
Originally Posted by 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
Code:
 mget SITE_ACTIVITY${LOG_DATE}*.CSV
Reply With Quote
  #7 (permalink)  
Old 09-15-2005
Registered User
 

Join Date: Apr 2005
Posts: 6
Stumble this Post!
I tried every thing

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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:51 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0