Help with error "syntax error: unexpected end of file"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with error "syntax error: unexpected end of file"
# 1  
Old 04-25-2013
Help with error "syntax error: unexpected end of file"

Hi Techies,

can anyone please debug the following Script and let me know what is going wrong here.

im getting the following error

Quote:
scripts$ ./retrieve-ETN-EMTN-enrichment-data.sh
./retrieve-ETN-EMTN-enrichment-data.sh: line 528: syntax error: unexpected end of file

Code:
 
#!/usr/bin/bash
# ##############################################################################################
#
# Variables
#
# ##############################################################################################
# General
curdir=`pwd`
dt=`date +%Y%m%d`
dateprefix=$(date '+20%y%m%d')
pvuserhomedir=/home/pvuser
rpmbenkdir="$pvuserhomedir"/Scripts/Interfaces/NIM
 
# Connection details
cramer4=XX.XX.XX.XX
USER_CRAMER4="XXXXX"
UPASSWD_CRAMER4="XXXXX"
FILEDIR_CRAMER4="/afs2/nimprd/current/data/P707/rpm/extract"
 
 
cramer6="XX.XX.XX.XX"
USER_CRAMER6="XXXXX"
UPASSWD_CRAMER6="YYYYY"
FILEDIR_CRAMER6="/ora/oss/OSS80/DB_DIR/bnsbvt/xxxx/yyyy/"
 
# Log directory and filename
logdir="$rpmbenkdir"/log
logfile=`date '+retrieve-ETN-EMTN-enrichment-data-log-20%y%m%d.log'`
# Directory containing configuration files: (header, footer) for error checking and mailing; file with static entries; etc
configdir="$rpmbenkdir"/config 
# Download directory
downloaddir="$rpmbenkdir"/downloads
# Intermediate work directory and files
workdir="$rpmbenkdir"/work
 
ETN_nodesC6_file=ETN-nodes_C6.csv
EMTN_nodesC6_file=EMTN-nodes_C6.csv
#ETN_nodesC4C6_file=ETN-nodes_C4C6.csv
ETN_nodesC6_errorfree_file=ETN-nodes_C6_errorfree.csv
ETN_EMTN_nodesC6_file=ETN-EMTN-nodes_C6.csv
ETN_EMTN_nodesC6_withmanualentries_file=ETN-EMTN-nodes_C6_withmanualentries.csv
 
#ETN_portsC4_file=ETN-ports_C4.csv
ETN_portsC6_Alcatel_file=ETN-ports_C6_Alcatel.csv
ETN_portsC6_WWP_file=ETN-ports_C6_WWP.csv
ETN_portsC6_Huawei_file=ETN-ports_C6_Huawei.csv
ETN_portsC6_file=ETN-ports_C6.csv
ETN_portsC4C6_file=ETN-ports_C4C6.csv
ETN_portsC4C6_errorfree_file=ETN-ports_C4C6_errorfree.csv
ETN_portsC4C6_withmanualentries_file=ETN-ports_C4C6_withmanualentries.csv
# Output directory and files
outputdir="$rpmbenkdir"/output
nodes_outputfile="ETN_EMTN_nodes_seedfile.txt"
ports_outputfile="ETN_ports_seedfile.txt"
# Archive directories
workarchivedir="$workdir"/archive
outputarchivedir="$outputdir"/archive
# Directory for scripts: compare-files.pl, ETN-ADD.pl, process-ETN-nodes.pl, etc
scriptdir="$rpmbenkdir"/scripts 
# Communication error emails
communication_error_C4_email_file=$configdir/commu_error_C4.txt
communication_error_C6_etnnodes_email_file=$configdir/commu_error_C6_etn-nodes.txt
communication_error_C6_EMTNNode_email_file=$configdir/commu_error_C6_EMTN-Node.txt
communication_error_C6_alcatelport_email_file=$configdir/commu_error_C6_alcatel-port.txt
communication_error_C6_wwpport_email_file=$configdir/commu_error_C6_wwp-port.txt
communication_error_C6_huaweiport_email_file=$configdir/commu_error_C6_huawei-port.txt
# ##############################################################################################
#
# Start
#
# ##############################################################################################
cd $pvuserhomedir
# Log starting of script including timestamp
echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=" >> $logdir/$logfile
echo "Starting: retrieve-ETN-EMTN-enrichment-data.sh" >> $logdir/$logfile
echo "Description: Retrieves files from NIM C4 and NIM C6, with network inventory info" >> $logdir/$logfile
echo " on ETN nodes and ports and EMTN nodes." >> $logdir/$logfile
echo " Invokes scripts to create seedfiles for RPM." >> $logdir/$logfile
date >> $logdir/$logfile
echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=" >> $logdir/$logfile
echo "" >> $logdir/$logfile
 
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NODES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NODES_COMM_ERR=0
echo "" >> $logdir/$logfile
echo "%%%%% NODES %%%%%" >> $logdir/$logfile
echo "" >> $logdir/$logfile
# ###########################
#
# * Retrieve NIM C6 file: etn-nodes
#
# ###########################
if [ $NODES_COMM_ERR -ne 1 ]
then
echo "+ Retrieving NIM C6 file: etn-nodes_..." >> $logdir/$logfile
# Download file
cd $downloaddir
ftp -i -v -n $cramer6 <<**>> $logdir/$logfile
user $USER_CRAMER6 $UPASSWD_CRAMER6
cd $FILEDIR_CRAMER6
mget $(date '+etn-nodes_20%y%m%d*.csv')
bye
**
#cd $downloaddir
#sftp $USER_CRAMER6@$cramer6 <<**>> $logdir/$logfile
#cd $FILEDIR_CRAMER6
#mget $(date '+etn-nodes_20%y%m%d*.csv')
#bye
#**
# Check if file is downloaded succesfully
if [ -f $downloaddir$(date '+/etn-nodes_20%y%m%d*.csv') ]
then
echo " ++++ Succesfully downloaded NIM C6 file: etn-nodes" >> $logdir/$logfile
# Create a copy of the downloaded file, but without time in filename. 
# Original file will remain in download folder for couple of days (archiving)
cp $downloaddir$(date '+/etn-nodes_20%y%m%d*.csv') $workdir$(date '+/etn-nodes_20%y%m%d.csv')
else
echo "ERROR: Problem downloading NIM C6 file: etn-nodes" >> $logdir/$logfile
echo "INFO: Sending e-mail about the communication error" >> $logdir/$logfile
# Notify helpdesk and Functional Manager RPM by e-mail about communication error
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" helpdesk_vm_im@kpn.com < $communication_error_C6_etnnodes_email_file
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" eric.kras@kpn.com < $communication_error_C6_etnnodes_email_file 
# Raise flag to prevent further creation of nodes seedfile
NODES_COMM_ERR=1
fi
else
echo "INFO: Skipping NIM C6 file: etn-nodes" >> $logdir/$logfile
fi
 
# ###########################
#
# * Retrieve NIM C6 file: EMTN-Node
#
# ###########################
if [ $NODES_COMM_ERR -ne 1 ]
then
echo "+ Retrieving NIM C6 file: EMTN-Node_..." >> $logdir/$logfile
# Download file
cd $downloaddir
ftp -i -v -n $cramer6 <<**>> $logdir/$logfile
user $USER_CRAMER6 $UPASSWD_CRAMER6
cd $FILEDIR_CRAMER6
mget $(date '+EMTN-Node_20%y%m%d*.csv')
bye
**
#cd $downloaddir
#sftp $USER_CRAMER6@$cramer6 <<**>> $logdir/$logfile
#cd $FILEDIR_CRAMER6
#mget $(date '+EMTN-Node_20%y%m%d*.csv')
#bye
#**
# Check if file is downloaded succesfully
if [ -f $downloaddir$(date '+/EMTN-Node_20%y%m%d*.csv') ]
then
echo " ++++ Succesfully downloaded NIM C6 file: EMTN-Node" >> $logdir/$logfile
# Create a copy of the downloaded file, but without time in filename. 
# Original file will remain in download folder for couple of days (archiving)
cp $downloaddir$(date '+/EMTN-Node_20%y%m%d*.csv') $workdir$(date '+/EMTN-Node_20%y%m%d.csv')
else
echo "ERROR:Problem downloading NIM C6 file: EMTN-Node" >> $logdir/$logfile
echo "INFO: Sending e-mail about the communication error" >> $logdir/$logfile
# Notify helpdesk and Functional Manager RPM by e-mail about communication error
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" helpdesk_vm_im@kpn.com < $communication_error_C6_EMTNNode_email_file
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" eric.kras@kpn.com < $communication_error_C6_EMTNNode_email_file 
# Raise flag to prevent further creation of nodes seedfile
NODES_COMM_ERR=1
fi
else
echo "INFO: Skipping NIM C6 file: EMTN-Node" >> $logdir/$logfile
fi
# ###########################
#
# * Call create-ETN-EMTN-nodes-seedfile.sh
#
# ###########################
if [ $NODES_COMM_ERR -ne 1 ]
then
echo ">>> Invoking: create-ETN-EMTN-nodes-seedfile.sh " >> $logdir/$logfile
$scriptdir/create-ETN-EMTN-nodes-seedfile.sh
else
echo "INFO: Skipping: create-ETN-EMTN-nodes-seedfile.sh " >> $logdir/$logfile
fi
 
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PORTS_COMM_ERR=0
echo "" >> $logdir/$logfile
echo "%%%%% PORTS %%%%%" >> $logdir/$logfile
echo "" >> $logdir/$logfile
# ###########################
#
# * Retrieve NIM C6 file: alcatel-port
#
# ###########################
if [ $PORTS_COMM_ERR -ne 1 ]
then
echo "+ Retrieving NIM C6 file: alcatel-port_..." >> $logdir/$logfile
# Download file
cd $downloaddir
ftp -i -v -n $cramer6 <<**>> $logdir/$logfile
user $USER_CRAMER6 $UPASSWD_CRAMER6
cd $FILEDIR_CRAMER6
mget $(date '+alcatel-port_20%y%m%d*.csv')
bye
**
#cd $downloaddir
#sftp $USER_CRAMER6@$cramer6 <<**>> $logdir/$logfile
#cd $FILEDIR_CRAMER6
#mget $(date '+alcatel-port_20%y%m%d*.csv')
#bye
#**
# Check if file is downloaded succesfully
if [ -f $downloaddir$(date '+/alcatel-port_20%y%m%d*.csv') ]
then
echo " ++++ Succesfully downloaded NIM C6 file: alcatel-port" >> $logdir/$logfile
# Create a copy of the downloaded file, but without time in filename. 
# Original file will remain in download folder for couple of days (archiving)
cp $downloaddir$(date '+/alcatel-port_20%y%m%d*.csv') $workdir$(date '+/alcatel-port_20%y%m%d.csv')
else
echo "ERROR: Problem downloading NIM C6 file: alcatel-port" >> $logdir/$logfile
echo "INFO: Sending e-mail about the communication error" >> $logdir/$logfile
# Notify helpdesk and Functional Manager RPM by e-mail about communication error
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" helpdesk_vm_im@kpn.com < $communication_error_C6_alcatelport_email_file
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" eric.kras@kpn.com < $communication_error_C6_alcatelport_email_file 
# Raise flag to prevent further creation of ports seedfile
PORTS_COMM_ERR=1
fi
else
echo "INFO: Skipping NIM C6 file download: alcatel-port" >> $logdir/$logfile
fi
# ###########################
#
# * Retrieve NIM C6 file: wwp-port
#
# ###########################
if [ $PORTS_COMM_ERR -ne 1 ]
then
echo "+ Retrieving NIM C6 file: wwp-port_..." >> $logdir/$logfile
# Download file
cd $downloaddirl
ftp -i -v -n $cramer6 <<**>> $logdir/$logfile
user $USER_CRAMER6 $UPASSWD_CRAMER6
cd $FILEDIR_CRAMER6
mget $(date '+wwp-port_20%y%m%d*.csv')
bye
**
#cd $downloaddir
#sftp $USER_CRAMER6@$cramer6 <<**>> $logdir/$logfile
#cd $FILEDIR_CRAMER6
#mget $(date '+wwp-port_20%y%m%d*.csv')
#bye
#**
# Check if file is downloaded succesfully
if [ -f $downloaddir$(date '+/wwp-port_20%y%m%d*.csv') ]
then
echo " ++++ Succesfully downloaded NIM C6 file: wwp-port" >> $logdir/$logfile
# Create a copy of the downloaded file, but without time in filename. 
# Original file will remain in download folder for couple of days (archiving)
cp $downloaddir$(date '+/wwp-port_20%y%m%d*.csv') $workdir$(date '+/wwp-port_20%y%m%d.csv')
else
echo "ERROR: Problem downloading NIM C6 file: wwp-port" >> $logdir/$logfile
echo "INFO: Sending e-mail about the communication error" >> $logdir/$logfile
# Notify helpdesk and Functional Manager RPM by e-mail about communication error
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" helpdesk_vm_im@kpn.com < $communication_error_C6_wwpport_email_file
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" eric.kras@kpn.com < $communication_error_C6_wwpport_email_file
# Raise flag to prevent further creation of ports seedfile
PORTS_COMM_ERR=1
fi
else
echo "INFO: Skipping NIM C6 file download: wwp-port" >> $logdir/$logfile
fi
 
 
# ###########################
#
# * Retrieve NIM C6 file: huawei-port
#
# ###########################
if [ $PORTS_COMM_ERR -ne 1 ]
then
echo "+ Retrieving NIM C6 file: huawei-port_..." >> $logdir/$logfile
# Download file
cd $downloaddirl
ftp -i -v -n $cramer6 <<**>> $logdir/$logfile
user $USER_CRAMER6 $UPASSWD_CRAMER6
cd $FILEDIR_CRAMER6
mget $(date '+huawei-port_20%y%m%d*.csv')
bye
**
#cd $downloaddir
#sftp $USER_CRAMER6@$cramer6 <<**>> $logdir/$logfile
#cd $FILEDIR_CRAMER6
#mget $(date '+huawei-port_20%y%m%d*.csv')
#bye
#**
# Check if file is downloaded succesfully
if [ -f $downloaddir$(date '+/huawei-port_20%y%m%d*.csv') ]
then
echo " ++++ Succesfully downloaded NIM C6 file: huawei-port" >> $logdir/$logfile
# Create a copy of the downloaded file, but without time in filename. 
# Original file will remain in download folder for couple of days (archiving)
cp $downloaddir$(date '+/huawei-port_20%y%m%d*.csv') $workdir$(date '+/huawei-port_20%y%m%d.csv')
else
echo "ERROR: Problem downloading NIM C6 file: huawei-port" >> $logdir/$logfile
echo "INFO: Sending e-mail about the communication error" >> $logdir/$logfile
# Notify helpdesk and Functional Manager RPM by e-mail about communication error
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" helpdesk_vm_im@kpn.com < $communication_error_C6_huaweiport_email_file
mailx -s "NIM C6 (BENK)-Proviso Interface: communication error" eric.kras@kpn.com < $communication_error_C6_huaweiport_email_file
# Raise flag to prevent further creation of ports seedfile
#PORTS_COMM_ERR=1 -commented till huawei nodes are available
fi
else
echo "INFO: Skipping NIM C6 file download: huawei-port" >> $logdir/$logfile
fi
 
 
# ###########################
#
# * Call create-ETN-ports-seedfile.sh
#
# ###########################
if [ $PORTS_COMM_ERR -ne 1 ]
then
echo ">>> Invoking: create-ETN-ports-seedfile.sh" >> $logdir/$logfile
$scriptdir/create-ETN-ports-seedfile.sh
else
echo "INFO: Skipping: create-ETN-ports-seedfile.sh " >> $logdir/$logfile
fi
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLEAN-UP ARCHIVE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
echo "" >> $logdir/$logfile
echo "%%%%% Archiving & archive cleaning %%%%%" >> $logdir/$logfile
echo "" >> $logdir/$logfile
# ###########################
#
# 3) Archive and delete old archive files (& logfiles)
#
# ###########################
echo "+ Archiving & deleting old archive files " >> $logdir/$logfile
if [ $NODES_COMM_ERR -ne 1 ]
then
# Move workfiles to archive
# mv $workdir/$ETN_nodesC4_file $workarchivedir/$dateprefix'_'$ETN_nodesC4_file
mv $workdir/$ETN_nodesC6_file $workarchivedir/$dateprefix'_'$ETN_nodesC6_file
mv $workdir/$EMTN_nodesC6_file $workarchivedir/$dateprefix'_'$EMTN_nodesC6_file
mv $workdir/$ETN_nodesC4C6_file $workarchivedir/$dateprefix'_'$ETN_nodesC4C6_file
mv $workdir/$ETN_nodesC6_errorfree_file $workarchivedir/$dateprefix'_'$ETN_nodesC6_errorfree_file
mv $workdir/$ETN_EMTN_nodesC6_file $workarchivedir/$dateprefix'_'$ETN_EMTN_nodesC6_file
mv $workdir/$ETN_EMTN_nodesC6_withmanualentries_file $workarchivedir/$dateprefix'_'$ETN_EMTN_nodesC6_withmanualentries_file
else
echo "INFO: Skipping: archiving of nodes work files" >> $logdir/$logfile
fi
if [ $PORTS_COMM_ERR -ne 1 ]
then
if [ $NODES_COMM_ERR -ne 1 ]
then
# Move workfiles to archive
# mv $workdir/$ETN_portsC4_file $workarchivedir/$dateprefix'_'$ETN_portsC4_file
mv $workdir/$ETN_portsC6_Alcatel_file $workarchivedir/$dateprefix'_'$ETN_portsC6_Alcatel_file
mv $workdir/$ETN_portsC6_WWP_file $workarchivedir/$dateprefix'_'$ETN_portsC6_WWP_file
mv $workdir/$ETN_portsC6_Huawei_file $workarchivedir/$dateprefix'_'$ETN_portsC6_Huawei_file
mv $workdir/$ETN_portsC6_file $workarchivedir/$dateprefix'_'$ETN_portsC6_file
mv $workdir/$ETN_portsC4C6_file $workarchivedir/$dateprefix'_'$ETN_portsC4C6_file
mv $workdir/$ETN_portsC4C6_errorfree_file $workarchivedir/$dateprefix'_'$ETN_portsC4C6_errorfree_file
mv $workdir/$ETN_portsC4C6_withmanualentries_file $workarchivedir/$dateprefix'_'$ETN_portsC4C6_withmanualentries_file
else
echo "INFO: Skipping: archiving of ports work files" >> $logdir/$logfile 
fi
else
echo "INFO: Skipping: archiving of ports work files" >> $logdir/$logfile
fi
# Remove remaining workfiles (copies of downloaded files)
rm $workdir/*.*
# Copy outputfiles to archive
cp $outputdir/$nodes_outputfile $outputarchivedir/$dateprefix'_'$nodes_outputfile
cp $outputdir/$ports_outputfile $outputarchivedir/$dateprefix'_'$ports_outputfile
# Delete files older than 2 weeks from the archive folders 
find $downloaddir -mtime +15 -exec rm {} \;
find $workarchivedir -mtime +15 -exec rm {} \;
find $outputarchivedir -mtime +15 -exec rm {} \;
# Delete logfiles older than 2 weeks
find $logdir -mtime +15 -exec rm {} \;
 
 
# ##############################################################################################
#
# End
#
# ##############################################################################################
# Log starting of script including timestamp
echo "" >> $logdir/$logfile
echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=" >> $logdir/$logfile
echo "End of script: retrieve-ETN-enrichment-data.sh" >> $logdir/$logfile
date >> $logdir/$logfile
echo "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=" >> $logdir/$logfile

i want to fix this ASAP, any help would be greatly appreciated.

Thanks a bunch in advance
# 2  
Old 04-25-2013
did you try running your script with
Code:
bash -x

, please share the logs if you did that.
# 3  
Old 04-25-2013
This isn't the correct forum if you need help ASAP.

Furthermore, it is obvious that you did not originally write this script. It appears that several people have made changes to the script over time and some of them didn't understand how it works. I will also assume that it was working until you recently changed a few lines causing the current syntax error. Rather than asking us to debug your entire 528 line shell script, why don't you highlight the changes you've recently made that introduced the syntax error.

I will give you some free advice and suggest that you change both of the lines:
Code:
**

to be:
Code:
#**

and note that some of the common reasons for this error from bash are a missing fi at the end of an if, a missing esac at the end of a case, and a missing done after a do.

But if you really want me to spend time debugging your script for you, I'm willing to negotiate a price. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error: "Syntax error; unexpected end of file"

Hello all, I am running a script to generate a report and mail it to an email address. When I am trying to validate whether the file is a 0 kb file, I am getting the below error. Error: "Syntax error; unexpected end of file" Any suggestions please? Code: #!/bin/sh .... (1 Reply)
Discussion started by: Pradeep_Raj
1 Replies

2. BSD

Keep getting error "-bash: ./.profile_z2: line 52: syntax error: unexpected end of file"

#!/bin/bash #-------------------------------------------------------- # Setup prompt # Author Zeeshan Mirza # Data: 06-08-2017 #-------------------------------------------------------- if then . ./.profile_custom_pre fi umask 022 set -o vi export EDITOR=vi export VISUAL=vi... (3 Replies)
Discussion started by: getzeeshan
3 Replies

3. Shell Programming and Scripting

Error"syntax error at line 15: `end of file' unexpected"

While i m running below code, it is giving me the error"syntax error at line 15: `end of file' unexpected". Pls let me know what is wrong here..i tried many ways, but no luck dbSID="SWQE" usrname="apps" password="Wrgthrk3" count=0 while do sqlplus $usrname/$password@$dbSID... (5 Replies)
Discussion started by: millan
5 Replies

4. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

5. Shell Programming and Scripting

Syntax error near unexpected token `"Hit <ENTER> to continue:"'

the below code will search attr string inside makefile under the modelno on given path. echo "Enter model no for searching string inside makefile" read inputs2 #find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \; #;;I am getting below error.... (7 Replies)
Discussion started by: lathigara
7 Replies

6. Shell Programming and Scripting

Bash (Ubuntu server): Syntax error: "|" unexpected in While-loop

Hello forum, I hope my problem is easy to solve for someone in here! My main task is to copy a large amount of imap-accounts from one server to another. There is a tool (Perl) called imapsync which does the job exellent. Unfortunately I'm only able to run it on one account at a time. After... (3 Replies)
Discussion started by: primaxx
3 Replies

7. Shell Programming and Scripting

Syntax error: word unexpected (expecting ")")

I have a very simple script that reads in the contents of a file (_open.txt) into an array "lyrics": #!/bin/sh # read in the text lyrics=( `cat _open.txt` | tr '\n' ' ') exit 0 It gives the following error message: ./lyrics.sh: 1: Syntax error: word unexpected (expecting ")") I have... (9 Replies)
Discussion started by: figaro
9 Replies

8. Solaris

"syntax error near unexpected token `fi' "

one of my script as follows HOME=/apps/logs mv $HOME/cron.log $HOME/cron.log.`date +%Y-%m-%d` touch $HOME/cron.log fi i am getting error as follows on the last line we are getting ... "syntax error near unexpected token `fi' " please suggest.... (4 Replies)
Discussion started by: GIC1986
4 Replies

9. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies

10. Shell Programming and Scripting

"syntax error at line 21 :'done' unexpected." error message"

I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message" can someone check to see if the script is ok? and correct me pls. Today is my first day with scripting. Gurus should pls help out #!/bin/ksh # Purpose: Check to see if file... (3 Replies)
Discussion started by: ibroxy
3 Replies
Login or Register to Ask a Question