UNIX Error in Script | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


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

UNIX Error in Script

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-23-2013
sourabh.chhabra sourabh.chhabra is offline
Registered User
 
Join Date: Mar 2013
Last Activity: 24 March 2013, 3:22 AM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
UNIX Error in Script

When i run a script in linux. It shows the following error.

Code:
'icsftpagent.sh: line 114: syntax error near unexpected token `
'icsftpagent.sh: line 114: `Nicsftp()


My Script is as follows:

Code:
#!/bin/bash 
#### Copyright Notice: 
#### 
#### Copyright (c) 2007 Network Intelligence Corporation 
#### 
#### Warning: This computer program is protected by copyright law and 
#### international treaties.  Unauthorized reproduction or distribution 
#### of this program, or any portion of it, may result in severe civil 
#### and criminal penalties, and will be prosecuted to the maximum 
#### extent possible under the law. 
#### 
#### RSA, The Security Division of EMC - Automated FTP/SCP/SFTP Script v2.7.11 
#### 
################### 
#### 
####   Begin User configuration 
#### 
########## 
######## 
###### 
#### 
#SILENT MODE 
#produce no output to the console;  
#set this to true when running from cron 
#to reduce emails sent to root. 
SILENT=true 
# Have the Solaris POSIX compliant binaries first in the path. 
# The /usr/bin directory in Solaris doesn't have POSIX compliant 
# binaries. This is particularly a problem for the awk command we are 
# using. (ECE-138) 
#PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/css/bin:$PATH 
## Enter the hostname/IP address of the enVision machine to which you want to 
## send the data files 
ENVISION=192.168.1.20 
## Enter the directories where the data files, which you need to send, exist.  Separate 
## multiple directories with a colon (:).  This script must have read permissions 
## to the directories. 
## Example for multiple folders DATA_DIRECTORY=/var/log/:/var/log/audit 
DATA_DIRECTORY=/var/log/ 
## The directory on the enVision box where the files should be written to.  This directory 
## is relative to the enVision/ftp_files directory.  If the directory name contains a 
## space it will need to be double escaped.  For example, if the directory name is 
## "name with spaces", the variable needs to be set to "name\ with\ spaces". 
ENVISION_DIRECTORY=Squid_192.168.1.63 
## The script keeps its persistent information in a directory.  The 
## script must have read and write permissions to this directory. 
NIC_DIRECTORY=/usr/local/nic 
## TRANSFER_METHOD=SFTP/SCP/FTP 
## Select the method used to transfer the files to enVision.  SFTP is recommended. 
## valid options are FTP, SFTP and SCP 
TRANSFER_METHOD=SFTP 
## Enter a username (ftp default: anonymous; SFTP/SCP default: nic_sshd) 
USERNAME=nic_sshd 
## Enter a password (anonymous connections accept any password) 
PASSWORD=RSAlab@12345 
## Enter the identity/private key file for the user specified above user 
## default is $HOME/.ssh/id_rsa 
IDENTITY=~/.ssh/id_rsa 
## Enter the file matching specification.  "*" will send any files in the directory. Separate 
## multiple fielnames with a colon (:). 
## Example for multiple files::  
## FILESPEC=*.log:xyz.log 
FILESPEC=access.log 
## Enter the file extension of uploaded files 
UPLOAD_SPEC=tmp 
## A value of "no" leaves the file intact after the transfer has occurred. 
## This should be set to "no" if you intend to manage the cleanup/archiving 
## of the original log data  with another process. 
FLAG_REMOVE_FILE_AFTER_SEND=no 
## The ftp or sftp client returns no error code if the transfer fails.  We assume the client 
## will return one (1) line (stating the local directory has changed).  If the client 
## you are using returns a different line count upon successful completion, then enter 
## that number here.  (You will most likely not need to change this.) 
NUMBER_OF_OUTPUT_LINE_ON_SFTP_SUCCESS=6 
## Enter 1 for Solaris, 3 for Red Hat 
NUMBER_OF_OUTPUT_LINE_ON_FTP_SUCCESS=1 
##  CONFIG FILE 
## Optionally define a config file that will override any settings made in this file. 
## This file must be located in the $NIC_DIRECTORY folder as defined in this script. 
NIC_CONFIG=nicsftpagent.conf 
## Script Name.  Used to make sure only one copy of the script is running. 
## If this script is renamed, change this setting to match. 
SCRIPT_NAME="nicsftpagent.sh" 
## Number of seconds to delay before terminating a job. This should be long enough 
## to allow transfer of your largest log files.  The script will update its activity between 
## each file copy.  If another instance is launched it will kill the original if it.s been this  
## many seconds since the original update in the running indicator file. 
KILL_RUNNING_AFTER=300 
## This script supports 2 version of tail.  The script will automaticaly determin the version  
## to use.  To force the use of one of the versions you can change this option. 
## 0 - automatic 
## 1 - tail +10 file 
## 2 - tail --lines=+10 file 
USETAIL=0 
## This script supports including the header in all log files.  This feature was added 
## in order to support the Oracle File System Audit log files. 
## 0 - feature disabled 
## 14 - header support for Oracle 
USEHEAD=0 
#### 
###### 
######## 
########## 
############ 
############ End User configuration 
############ 
################################################################################ 
################################################################################ 
#                                                                               
#                         DO NOT EDIT BELOW THIS LINE                           
#                                                                               
################################################################################ 
################################################################################ 
Nicsftp() 
{ 
                if ["x$SILENT" = "x" ] 
                then 
                    echo "**** Reading new data from $d/$i" 
                fi 
 
                # Support for use of headers - added version 2.7.3 
                if [ $USEHEAD -gt 0 ] 
                then 
                    head --lines $USEHEAD "$d/$i" > "$NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                    TMPCOUNT=`expr $TMPCOUNT - $USEHEAD` 
                    if [ "x$SILENT" = "x" ] 
                    then 
                        echo "**** Re-writing file header." 
                    fi 
                else 
                if [ "x$SILENT" = "x" ] 
                    then 
                    echo "**** Skipping file header." 
                    fi 
                fi 
 
                # Support for different version of tail 
                if [ "x$USETAIL" = "x0" ] 
                then 
                    if [ "x$SILENT" = "x" ] 
                    then 
                        echo "**** Automatic tail syntax checking.  You may see an error that can be ignored." 
                    fi 
                    tail +1 "$d/$i" >/dev/null 2>/dev/null 
                    if [ $? -gt 0 ] 
                    then  
                        USETAIL=2 
                    else 
                        USETAIL=1 
                    fi 
                    if [ "x$SILENT" = "x" ] 
                    then 
                            echo "**** Use tail syntax $USETAIL." 
                    fi 
                fi 
                if [  "x$USETAIL" = "x1" ] 
                ## Conditions to check to see if file has already been read - version 2.7.3 
                then 
                    if [ -f "$NIC_DIRECTORY$d/$i-nic.last.line" ] 
                        then 
                            tail +$LAST "$d/$i" >> "$NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                        else 
                            tail +$LAST "$d/$i" > "$NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                    fi 
                else 
                    if [ -f "$NIC_DIRECTORY$d/$i-nic.last.line" ] 
                        then 
                            tail --lines=+$LAST "$d/$i" >> "$NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                        else 
                            tail --lines=+$LAST "$d/$i" > "$NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                    fi 
                    if [ $? -gt 0 ] 
                    then 
                        echo "**** Critical failure when running tail" 
                        # exit script now. 
                        # clean up running files 
                        rm -f "$NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                        if [ "x$SILENT" = "x" ] 
                        then 
                            echo "**** removing running files" 
                        fi 
                        if [ -f "$NIC_DIRECTORY/running$ENVISION" ] 
                        then 
                            rm -f "$NIC_DIRECTORY/running$ENVISION" 
                        fi 
 
                        if [ -f "$NIC_DIRECTORY/running$ENVISION.pid" ] 
                        then 
                            rm -f "$NIC_DIRECTORY/running$ENVISION.pid" 
                        fi 
                        exit 1 
                    fi 
                fi 
 
                TMPCOUNT=`wc -l "$NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" | awk '{print $1}'` 
                ## Added for version 2.7.3 
                if [ -f "$NIC_DIRECTORY$d/$i-nic.last.line" ] 
                then 
                    TMPCOUNT=`expr $TMPCOUNT - $USEHEAD` 
                fi 
 
                ################################################### 
                #     No Transfer Option   
                ################################################### 
                if [ "$TRANSFER_METHOD" = "xNONE" ] 
                then 
                    echo "**** Generated $NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC (Transfer disabled)" 
                ################################################### 
                #     FTP Transfer Option 
                ################################################### 
                elif [ "x$TRANSFER_METHOD" = "xFTP" ] 
                then 
                    if [ "x$SILENT" = "x" ] 
                    then 
                        echo "**** Beginning FTP transfer of $d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                    fi 
 
                    ftp -n $ENVISION > "$NIC_DIRECTORY/transfer.output" 2> "$NIC_DIRECTORY/transfer.stderr" <<END1 
                    quote USER $USERNAME 
                    quote PASS $PASSWORD 
                    lcd "$NIC_DIRECTORY$d" 
                    cd "$ENVISION_DIRECTORY" 
                    put "$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC$GZ" 
                    quit 
END1 
                    if [ `wc -l "$NIC_DIRECTORY/transfer.output" | awk '{print $1}'` -gt $NUMBER_OF_OUTPUT_LINE_ON_FTP_SUCCESS ] 
                    then 
                        if [ "x$SILENT" = "x" ] 
                        then 
                            echo "**** There may have been errors during the transfer:(" 
                        fi 
 
                        cat "$NIC_DIRECTORY/transfer.output" 
                        TRANSFER_ERRORS=yes 
                    fi 
                ################################################### 
                #  SFTP  Transfer Option 
                ################################################### 
                elif [ "x$TRANSFER_METHOD" = "xSFTP" ] 
                then 
                    echo lcd \"$NIC_DIRECTORY$d\" > "$NIC_DIRECTORY/sftp.in" 
                    echo cd \"$ENVISION_DIRECTORY\" >> "$NIC_DIRECTORY/sftp.in" 
                    echo put \"$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC$GZ\" \"$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC$GZ\" >> $NIC_DIRECTORY/sftp.in 
                    echo quit >> $NIC_DIRECTORY/sftp.in 
                    sftp -b "$NIC_DIRECTORY/sftp.in" -oIdentityFile="$IDENTITY" $USERNAME@$ENVISION  > "$NIC_DIRECTORY/transfer.output" 2> "$NIC_DIRECTORY/transfer.stderr" 
 
                    if [ $? != "0" ] 
                    then 
                        echo "**** Error detected during transfer:" 
                        echo "" 
                        cat "$NIC_DIRECTORY/transfer.output" 
                        cat "$NIC_DIRECTORY/transfer.stderr" 
                        echo "" 
                        TRANSFER_ERRORS=yes 
                    fi 
 
                    if [ `wc -l "$NIC_DIRECTORY/transfer.output" | awk '{print $1}'` -gt $NUMBER_OF_OUTPUT_LINE_ON_SFTP_SUCCESS ] 
                    then 
                        echo "**** There may have been errors during the transfer:" 
                        echo "" 
                        cat "$NIC_DIRECTORY/transfer.output" 
                        cat "$NIC_DIRECTORY/transfer.stderr" 
                        echo "" 
                        TRANSFER_ERRORS=yes 
                    fi 
                ################################################### 
                #  SCP Transfer  Option 
                ################################################### 
                elif [ "x$TRANSFER_METHOD" = "xSCP" ] 
                then 
                    if [ "x$SILENT" = "x" ] 
                    then 
                        echo "**** Beginning SCP transfer of $d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                    fi 
 
                    /usr/bin/scp -i "$IDENTITY" "$NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC$GZ" $USERNAME@$ENVISION:\"$ENVISION_DIRECTORY\"/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC$GZ > "$NIC_DIRECTORY/transfer.output" 2> "$NIC_DIRECTORY/transfer.stderr" 
                    if [ $? != "0" ] 
                    then 
                        if [ "x$SILENT" = "x" ] 
                        then 
                            echo "**** Error detected during SCP transfer:" 
                        fi 
 
                        cat "$NIC_DIRECTORY/transfer.output" 
                        TRANSFER_ERRORS=yes 
                    fi 
                else 
                    echo "No Transfer Method Selected. ($TRANSFER_METHOD)" 
                    TRANSFER_ERRORS=yes 
                fi 
                ################################################### 
                #  Transfer Complete 
                ################################################### 
 
                if [ "x$SILENT" = "x" ] 
                then 
                    echo "**** Removing temporary data file $i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                fi 
 
                rm -f "$NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
 
                if [ "$TRANSFER_ERRORS" = "yes" ] 
                then 
                    echo "**** Transfer Errors processing $NIC_DIRECTORY$d/$i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC" 
                    echo "**** Exiting Script" 
                    mv -f "$NIC_DIRECTORY/transfer.output" "$NIC_DIRECTORY/transfer.output.lasterr" 
                    mv -f "$NIC_DIRECTORY/transfer.stderr" "$NIC_DIRECTORY/transfer.stderr.lasterr" 
 
                    # clean up running files 
                    if [ "x$SILENT" = "x" ] 
                    then 
                        echo "**** removing running files" 
                    fi 
 
                    if [ -f "$NIC_DIRECTORY/running$ENVISION" ] 
                    then 
                        rm -f "$NIC_DIRECTORY/running$ENVISION" 
                    fi 
 
                    if [ -f "$NIC_DIRECTORY/running$ENVISION.pid" ] 
                    then 
                        rm -f "$NIC_DIRECTORY/running$ENVISION.pid" 
                    fi 
 
                    if [ -f "$NIC_DIRECTORY/waiting$ENVISION" ] 
                    then 
                        rm -f "$NIC_DIRECTORY/waiting$ENVISION" 
                    fi 
                    exit 1 
                else 
                    NEWLINE=`expr $LAST + $TMPCOUNT` 
                     
                    if [ "x$SILENT" = "x" ] 
                    then 
                        echo "**** Updating file line count previous count: $LAST new count: $NEWLINE" 
                    fi 
 
                    echo "$NEWLINE" > "$NIC_DIRECTORY$d/$i-nic.last.line" 
 
                                        touch "$NIC_DIRECTORY$d/$i-nic.last.time" 
 
                    if [ "x$FLAG_REMOVE_FILE_AFTER_SEND" = "xyes" ] 
                    then 
                        if [ "x$SILENT" = "x" ] 
                        then 
                            echo "**** Removing Log File $i" 
                        fi 
                        rm -f "$i" 
                    fi 
 
                    mv -f "$NIC_DIRECTORY/transfer.output" "$NIC_DIRECTORY/transfer.output.last" 
                    mv -f "$NIC_DIRECTORY/transfer.stderr" "$NIC_DIRECTORY/transfer.stderr.last" 
                fi 
} 
 
###  Get config file if it exists; overrides anything set above. 
if [ -f "$NIC_DIRECTORY/$NIC_CONFIG" ] 
then 
    . "$NIC_DIRECTORY/$NIC_CONFIG" 
 
    if [ "x$SILENT" = "x" ]  
    then  
        echo "Loaded config file $NIC_DIRECTORY/$NIC_CONFIG" 
    fi 
 
elif [ -f "$NIC_CONFIG" ] 
then 
    . "$NIC_CONFIG" 
 
        if [ "x$SILENT" = "x" ]  
    then  
        echo "Loaded config file $NIC_CONFIG" 
    fi 
fi 
################################################# 
# If a copy of the script is running.  exit now.# 
################################################# 
if [ -f "$NIC_DIRECTORY/running$ENVISION" ] 
then 
    if [ "x$SILENT" = "x" ] 
    then 
        echo "A file exists indicating an instance of the script" 
        echo "is already running.  If the script has not updated" 
        echo "this file in $KILL_RUNNING_AFTER seconds, this original" 
        echo "process will be stopped." 
    fi 
 
    RUNNING=`cat "$NIC_DIRECTORY/running$ENVISION" 2>/dev/null` 
    #WAITING=`date +%s` 
    #Bug 112031 
    WAITING=`perl -e 'print time(),"\n"'` 
    DIFF=`expr $WAITING - $RUNNING` 
 
    if [ $DIFF -gt $KILL_RUNNING_AFTER ] 
    then 
        if [ "x$SILENT" = "x" ] 
        then 
            echo "The previous script has not responded in $DIFF" 
            echo "seconds.  If it is still running we will attempt to stop it." 
        fi 
 
        rm -f "$NIC_DIRECTORY/running$ENVISION" 
        # kill the pid now. 
        OLDPID=`cat "$NIC_DIRECTORY/running$ENVISION.pid" 2>/dev/null` 
 
        if [ `ps -aef | grep $OLDPID | grep $SCRIPT_NAME | wc -l | awk '{print $1}'` -gt 0 ] 
        then 
            if [ "x$SILENT" = "x" ] 
            then 
                echo "This script running on PID $OLDPID is inactive and being killed." 
            fi 
            kill -9 $OLDPID 
        fi 
    else 
        if [ "x$SILENT" = "x" ] 
        then 
            echo "The previous instance was active $DIFF seconds ago." 
            echo "This instance will exit now." 
        fi 
 
        exit 0; 
    fi 
fi 
 
TIMENAME=`date +%Y%m%d%H%M%S` 
 
################################################# 
# what are we going to do 
################################################# 
 
if [ "x$SILENT" = "x" ] 
then 
    echo "*******************************************************" 
    echo "****    Time: $TIMENAME" 
    echo "****    Data Directory(s): $DATA_DIRECTORY" 
    echo "****    NIC Directory: $NIC_DIRECTORY" 
    echo "****    enVision: $ENVISION" 
    echo "****    envision Directory: $ENVISION_DIRECTORY" 
    echo "*******************************************************" 
fi 
### Test that NIC directory exists 
if [ ! -d "$NIC_DIRECTORY" ] 
then 
    echo "$NIC_DIRECTORY cannot be found." 
    exit 1 
fi 
PWD=`pwd` 
### Test that each of the data directories exists 
for d in `echo "$DATA_DIRECTORY" | awk '{split($0, a, ":"); for (i in a) print a[i]; }'` 
do 
    if [ ! -d $d ] 
    then 
        echo "$d cannot be found." 
        exit 1 
    elif [ -d "$NIC_DIRECTORY$d" ] 
    then 
        # Clear out old tracking files 
         
        cd "$NIC_DIRECTORY$d" 
 
        if [ "x$SILENT" = "x" ] 
        then 
            echo "Checking for old tracking files in $NIC_DIRECTORY$d" 
        fi  
 
        #for j in `ls *-nic.* | awk 'BEGIN{FS="-nic"} {print $1}'` 
        #ls *-nic.* | while read j 
        find . -name "*-nic.*" -type f -print | awk 'BEGIN{FS="/"} {print $2}' | while read j 
        do 
            PASTFILETEMP=`echo $j | awk 'BEGIN{FS="-nic"} {print $1}'` 
            if [ ! -f "$d/$PASTFILETEMP" ] 
            then 
                if [ "x$SILENT" = "x" ] 
                then 
                    echo "remove $NIC_DIRECTORY$d/$PASTFILETEMP-nic.last.line" 
                fi 
                rm -f "$NIC_DIRECTORY$d/$PASTFILETEMP-nic.last.line" 
            fi 
        done  
    fi 
done 
DIRCOUNT=0 
for d in `echo "$DATA_DIRECTORY" | awk '{split($0, a, ":"); for (i in a) print a[i]; }'` 
do 
    DIRCOUNT=`expr $DIRCOUNT + 1` 
    cd "$d" 
    mkdir -p "$NIC_DIRECTORY$d" 
 
    if [ "x$SILENT" = "x" ] 
    then 
        echo "**** Scanning directory $d..." 
    fi 
              
    for i in `echo "$FILESPEC" | awk '{split($0, a, ":"); for (k in a) print a[k]; }'` #Array has been added to $FILESPEC to support multiple filenames for multiple folders 
    #ls $FILESPEC | while read i 
    #find . -name "$FILESPEC" -type f -print | awk 'BEGIN{FS="/"} {print $2}' | while read i  
    do 
        if [ "x$SILENT" = "x" ] 
        then 
            echo "**** Processing $i..." 
        fi 
 
        # running date 
        #date +%s > "$NIC_DIRECTORY/running$ENVISION" 
        #Bug 112031 
        THEDATE=`perl -e 'print time(),"\n"'` 
        echo $THEDATE > "$NIC_DIRECTORY/running$ENVISION" 
        # running pid 
        echo $$ > "$NIC_DIRECTORY/running$ENVISION.pid" 
        # 
 
        if [ -f "$i" ] 
        then 
            TRANSFER_ERRORS=no 
            TIMESTAMP=`date +%Y%m%d%H%M%S` 
            LAST=1 
 
            if [ -f "$NIC_DIRECTORY$d/$i-nic.last.line" ] 
            then 
                LAST=`cat "$NIC_DIRECTORY$d/$i-nic.last.line" 2>/dev/null` 
            fi 
 
            WC=`wc -l "$i" | awk '{print $1}'` 
            WC=`expr $WC + 1` 
 
            if [ $WC -lt $LAST ] 
            then 
                LAST=1 
                                if [ "x$SILENT" = "x" ]  
                then 
                    echo "**** WARNING: file was shorter than expected.  Reading from the beginning." 
                        echo "**** Log file will be processed from line $LAST to $WC." 
                fi 
            fi 
         
            if [ $WC -eq $LAST ] 
            then 
                if [ -f "$NIC_DIRECTORY$d/$i-nic.last.time" ] 
                then                                        
                    if [ $NIC_DIRECTORY$d/$i-nic.last.time -ot $i ] 
                    then 
                                             LAST=1 
                         if [ "x$SILENT" = "x" ] 
                         then 
                                                echo "**** File $i timestamp has changed. Reading from the beginning" 
                                echo "**** Log file will be processed from line $LAST to $WC." 
                                             fi 
                         Nicsftp 
                    else 
                         #Fix bug 25079 
                         if [ "x$FLAG_REMOVE_FILE_AFTER_SEND" = "xyes" ]  
                         then 
                            if [ "x$SILENT" = "x" ] 
                            then 
                                echo "**** Removing Log File $i" 
                            fi 
                            rm -f "$i" 
                         fi 
                         # 
                    fi 
                else 
                    if [ "x$SILENT" = "x" ] 
                    then 
                        echo "**** No new data in $i." 
                                                TMPCOUNT=0 
                    fi 
                fi 
            else 
                #Fix bug ECE-165 
                if [ -f "$NIC_DIRECTORY$d/$i-nic.last.time" ] 
                then 
                    if [ $NIC_DIRECTORY$d/$i-nic.last.time -ot $i ] 
                    then 
                        if [ "x$FLAG_REMOVE_FILE_AFTER_SEND" = "xyes" ] 
                        then 
                            # Start from the beginning 
                            LAST=1 
                            if [ "x$SILENT" = "x" ] 
                            then 
                                echo "**** File $i timestamp has changed. Reading from the beginning" 
                                echo "**** Log file will be processed from line $LAST to $WC." 
                            fi 
                        fi 
                    fi 
                else 
                    LAST=1 
                fi 
                #End Fix 
                Nicsftp 
            fi 
 
            if [ "x$SILENT" = "x" ]  
            then 
                echo "**** Done processing file $d/$i ($i-nic.$TIMESTAMP-$DIRCOUNT.$UPLOAD_SPEC Sent $TMPCOUNT Lines)" 
            fi 
        fi 
    done 
 
    if [ "x$SILENT" = "x" ] 
    then 
        echo "**** Done processing directory $d" 
    fi 
done 
cd "$PWD" 
# clean up running files 
if [ "x$SILENT" = "x" ] 
then 
    echo "**** removing running files" 
fi 
 
if [ -f "$NIC_DIRECTORY/running$ENVISION" ] 
then 
    rm -f "$NIC_DIRECTORY/running$ENVISION" 
fi 
 
if [ -f "$NIC_DIRECTORY/running$ENVISION.pid" ] 
then 
    rm -f "$NIC_DIRECTORY/running$ENVISION.pid" 
fi 
 
if [ "x$SILENT" = "x" ] 
then 
    echo "**** Script Completed." 
fi

---------- Post updated at 03:18 PM ---------- Previous update was at 02:21 PM ----------

Waiting for quick reply.... Pls help me out... Its urgent.

Last edited by zaxxon; 03-23-2013 at 06:05 AM..
Sponsored Links
    #2  
Old 03-23-2013
zaxxon's Avatar
zaxxon zaxxon is online now Forum Staff  
code tag tagger
 
Join Date: Sep 2007
Last Activity: 17 April 2014, 2:16 AM EDT
Location: St. Gallen, Switzerland
Posts: 6,159
Thanks: 108
Thanked 428 Times in 398 Posts
Everyone at the UNIX and Linux Forums gives their best effort to reply to all questions in a timely manner. For this reason, posting questions with subjects like "Urgent!" or "Emergency" and demanding a fast reply are not permitted in the regular forums.

For members who want a higher visibility to their questions, we suggest you post in the Emergency UNIX and Linux Support Forum. This forum is given a higher priority than our regular forums.

Posting a new question in the Emergency UNIX and Linux Support Forum requires forum Bits. We monitor this forum to help people with emergencies, but we do not not guarantee response time or best answers. However, we will treat your post with a higher priority and give our best efforts to help you.

If you have posted a question in the regular forum with a subject "Urgent" "Emergency" or similar idea, we will, more-than-likely, close your thread and post this reply, redirecting you to the proper forum.

Of course, you can always post a descriptive subject text, remove words like "Urgent" etc. (from your subject and post) and post in the regular forums at any time.


Thank you.

The UNIX and Linux Forums
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Syntax Error in Unix Shell Script Mary James Shell Programming and Scripting 4 06-15-2012 06:58 AM
AWK syntax /bailing script error when executing in UNIX nandugo1 Shell Programming and Scripting 4 03-03-2011 06:51 PM
Error in Unix Script joyrules Shell Programming and Scripting 5 03-18-2009 12:02 PM
forcefully throwing error : unix script dr46014 UNIX for Dummies Questions & Answers 1 10-01-2008 03:42 AM
Error while trying to fire a PL/SQL thro Unix Script dharmesht Shell Programming and Scripting 5 12-11-2003 09:10 AM



All times are GMT -4. The time now is 02:41 AM.