The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
proble in running .properties file sari Linux 0 04-22-2008 03:25 AM
help me in sending parameters from sqlplus script to unix shell script Hara Shell Programming and Scripting 2 01-29-2008 03:31 PM
Awk array proble!!!Please help timj123 Shell Programming and Scripting 0 01-28-2008 09:02 PM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 03:06 AM
Big (at least to me) sed proble go4desperado Shell Programming and Scripting 1 02-04-2007 06:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-25-2006
ravindra shukla ravindra shukla is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 4
proble in ftp script

i had written one script
that make connection with remote host
get some file and close the connection ..
it works fine .. but when i put this scrip in between control structure commands like "if , case " then it give me error like" syntax error at line 26 : `<<' unmatched"

please tell me can we use automated ftp script in control structure
my script is

Code:
Oms_host=$1
oms_login=$2
oms_pass=$3
oms_installation_location=$4


JAR_FILE1=omsconnectors-src.jar
JAR_FILE2=omsconnectors.jar
JAR_FILE3=oms_api.jar


CSV_FILE1=ExternalCreditCheck.csv
CSV_FILE2=GetAddressById.csv
CSV_FILE3=InternalCreditCheck.csv
CSV_FILE4=GetCustomerInfo.csv


echo " INPUT oms host   ${Oms_host} oms login ${oms_login} oms pass ${oms_pass}"
echo " oms_installation_location == ${oms_installation_location}"
echo " INPUT oms host   ${Oms_host} oms login ${oms_login} oms pass ${oms_pass}"


check=Y
if [[${check}= Y]]
       then
         ftp -n ${Oms_host} << EOT
                        user ${oms_login} ${oms_pass}
                        cd ${oms_installation_location}/omsserver
                        get apm.xml
                        cd ..
                        cd AMSS_Configuration
                        get ${JAR_FILE1}
                        get ${JAR_FILE2}
                        cd weblogic
                        get ${JAR_FILE3}
                        bye
                        EOT
       else 
         echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"       
   fi

Last edited by blowtorch; 08-28-2006 at 03:45 AM..
  #2 (permalink)  
Old 08-25-2006
Klashxx's Avatar
Klashxx Klashxx is offline Forum Advisor  
HP-UX/Linux/Oracle
  
 

Join Date: Feb 2006
Location: Almería, Spain
Posts: 393
Try:
Code:
ftp -n ${Oms_host} <<-EOF
user ${oms_login} ${oms_pass}
cd ${oms_installation_location}/omsserver
get apm.xml
cd ..
cd AMSS_Configuration
get ${JAR_FILE1}
get ${JAR_FILE2}
cd weblogic
get ${JAR_FILE3}
bye
EOF
  #3 (permalink)  
Old 08-25-2006
ravindra shukla ravindra shukla is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 4
thanks for your reply ..
but if i put this script in a control structure block
i mean in (IF ELSE )block ..it does not work

it gives me such error
"syntax error at line 25 : `<<' unmatched"

please help
  #4 (permalink)  
Old 08-25-2006
Glenn Arndt's Avatar
Glenn Arndt Glenn Arndt is offline Forum Advisor  
Anomalous Lurker
  
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
Code:
[[${check}= Y]]
Should be
Code:
[[ ${check} = Y ]]
  #5 (permalink)  
Old 08-28-2006
ravindra shukla ravindra shukla is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 4
Thanks for reply, but this is not a correct reason
Even you put automated ftp script in a function it gives same error
  #6 (permalink)  
Old 08-28-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Remove the tab/space characters that you have in the script before the second EOT.
Code:
if [[ ${check} = Y ]]
       then
         ftp -n ${Oms_host} << EOT
                        user ${oms_login} ${oms_pass}
                        cd ${oms_installation_location}/omsserver
                        get apm.xml
                        cd ..
                        cd AMSS_Configuration
                        get ${JAR_FILE1}
                        get ${JAR_FILE2}
                        cd weblogic
                        get ${JAR_FILE3}
                        bye
EOT
       else 
         echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"       
   fi
  #7 (permalink)  
Old 08-28-2006
ravindra shukla ravindra shukla is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 4
Thanks blowtorch ,

now its working ... ones again thanks for your reply

I have one more related problem. Hope you will help me.
Scenario is like this
I have one main script, that works fine … but when I copied this automated ftp script code in my main script
My main script exited after execution of this ftp code ..
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0