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
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 03:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy