Sponsored Content
Top Forums Shell Programming and Scripting I am getting strange message when run borne shell script Post 302993093 by digioleg54 on Monday 6th of March 2017 05:51:12 PM
Old 03-06-2017
I am getting strange message when run borne shell script

I have a code:
Code:
 if [ -d ${COOLDIR}/cool_${Today}/daily ]
then#{ process daily files
 for file in *_${Today}*.csv *_${Today}*.txt
do
        if [ -f "LET_daily_trans_${Today}.csv" ] || [ -f "LET_daily_trans_345_${Today}.csv" ]
        then
                echo "This file will be processed in separate script"
                continue
        fi
         if [ "${prefix}" = "MBSE_daily_trans_sum_" ];then
                                sftp_name=MBSEDTRNSUM
                        elif [ "${prefix}" = "MBSE_daily_trans_badcpn_" ];then
                                sftp_name=MBSEDTRNBADCPN
                        elif [ "${prefix}" = "MBSE_daily_trans_sum_345_" ];then
                                sftp_name=MBSEDTRNSUM345
                        elif [ "${prefix}" = "MBSE_daily_trans_badcpn_345_" ];then
                                sftp_name=MBSEDTRNBADCPN345
                        elif [ "${prefix}" = "MBSE_daily_trans_" ];then
                                sftp_name=MBSEDAYTRNS
                        elif [ "${prefix}" = "MBSE_daily_trans_345_" ];then
                                sftp_name=MBSEDAYTRNS345
                        else
                                echo "Unnkowned prefix name ${prefix}"
           fi
           if [ "${ext}" != "txt" ];then
                     do something
           fi

 done
 
for file in *.${Today}*.csv *.${Today}*.txt
do
  if [ -f daily_tba_position.${Today} ] || [ -f daily_pool_position.${Today} ] || [ -f LET.${Today} ];then
                echo "files were processed by the brkvol_day_sftp_ondemand.sh script"
                continue
  fi
 if [ "${ext}" != "txt" ]
  then
     do something
               if [ "${fldt}" = "-" ];then
                          do something
               else
                  do something
               fi
        do something
    else
          do something
    fi
 if [ "${ext}" != "txt" ];then
          do something                     
                                
 else
           do something                     
  fi

 done
 fi #} finished to process daily files line 384

When I try to run the borne shell script I am getting message
Code:
 ./sftp_ondemand.sh[95]: syntax error at line 384 : `fi' unexpected

Could you please let me know why?

Thanks for contribution

Last edited by digioleg54; 03-06-2017 at 07:08 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Modifying from borne shell to C shell

Just want to know a few conversion tricks. in Borne Shell, I have the line: if test -s testmap then ... fi ## testmap is a filename and I wanna test whether it exists ## then do whatever How can I convert that to C Shell? I've tried: if (test -s testmap) then ... endif but it... (3 Replies)
Discussion started by: zenkisoft
3 Replies

2. Shell Programming and Scripting

Can there be multi-dimensional variable arrays in borne shell?

Hello - I've serached the web but can't find much on array script variables (except that C-shell variables are arrays!) I'm trying to form a 2-D string array: (this is what I want, but in java) String list = { {"one", "two"}, {"three"} }; I know this is a 1-D string array shell... (4 Replies)
Discussion started by: jparker
4 Replies

3. Shell Programming and Scripting

ed strange error message

When I start ed as regular user, following message is displayed: $ed ERROR: tempnam failed: Permission denied $ I think, following error produced in vi when search results from previous error: No previous regular expression Setting TMPDIR variable cause no effect. As root all works... (6 Replies)
Discussion started by: frenki
6 Replies

4. UNIX for Dummies Questions & Answers

Need Help With My First Borne Shell Program

I'm working on writing my very first borne shell program and I need some help. I think I'm pretty close to having this correct but I may be off. I think my actual program is coded correctly but the commands I use within it I think are what's throwing it off? **Purpose of the program: To... (3 Replies)
Discussion started by: FuzzyNips
3 Replies

5. Shell Programming and Scripting

UNIX Find command in Borne Shell

I need to perform two separate commands as part of the -exec section of a find command. Is this possible? (1 Reply)
Discussion started by: marshaferry
1 Replies

6. Shell Programming and Scripting

Documenattion on Borne And C shell programming

Hi experts, I am new bee in unix programming. How to differenciate a Borne and C shell programming. Can i write a C shell syntax in Borne again shell. Please send me the good links on Borne and Cshell programming . Any help in this regard will be highly appreciated. Regards, Azaz. (3 Replies)
Discussion started by: azazalis
3 Replies

7. UNIX for Dummies Questions & Answers

borne shell script

I need anwser to this qestion! I havewirte a script that provides line numbered contents of a file which must make use of the following control structures files Command line arguments I am a complete new commer to unix and bourne shell scripting can any one help (1 Reply)
Discussion started by: migg-21
1 Replies

8. Shell Programming and Scripting

Shell script to run command + compare values and post a warning message.

Hi all, I am trying to create shell script to run command then compare values with rule set for every 5 seconds and post a warning message if the compared value meet the rules. -the script is related to Oracle/Sun product messaging server 6.2 1) command that need to be run to gather... (2 Replies)
Discussion started by: Mr_47
2 Replies

9. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies
DWWW-REFRESH-CACHE(8)						      Debian						     DWWW-REFRESH-CACHE(8)

NAME
dwww-refresh-cache - rebuilds dwww cache directory SYNOPSIS
dwww-refresh-cache DESCRIPTION
dwww-refresh-cache is a simple shell script, which deletes outdated cache files and rebuilds contents of the dwww cache directory /var/cache/dwww. In default installation, the script is called from /etc/cron.daily/dwww, so the cache is refreshed every day. CONFIGURATION VARIABLES
DWWW_KEEPDAYS Specifies, how many days documents that have not been accessed should be kept in the cache. Default is 10 days. DWWW_QUICKFIND_DB Location of the installed packages and programs cache file, generated with help of dwww-quickfind(8). Default is /var/cache/dwww/quickfind.dat. DWWW_DOCBASE2PKG_DB Location of the cache file, which maps installed doc-base files to packages names, used by the dwww-build-menu(8). Default is /var/cache/dwww/docbase2pkg.dat. FILES
/etc/dwww/dwww.conf Configuration file for dwww(7). /var/cache/dwww dwww cache directory. /etc/cron.daily/dwww. dwww daily cron job SEE ALSO
dwww(7), dwww-build-menu(8), dwww-cache(8), dwww-find(8). AUTHOR
Robert Luberda. See dwww(7), for copyrights and stuff. dwww 1.11.1 February 15th, 2009 DWWW-REFRESH-CACHE(8)
All times are GMT -4. The time now is 12:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy