Problem embedding FTP command in case statement w/in function

Problem embedding FTP command in case statement w/in function

Post by anti_p.. » Sat, 11 Mar 2000 04:00:00



Is it possible to nest a set of FTP commands in a case statement?
I cannot get this portion of my script to function.  The korn shell
returns the following message:  "Syntax error at line 102 : `<' is not
matched"

#########################################################
function buildlib {
#########################################################
  if [[ $# != 3 ]];then
    print "${0} called with bad number of parameters -- terminating"
    exit 1
  fi
  DestLib=${1}
  SourceFusr=${2}
  SourceLib=${3}

  # Check for Unix or Windows
  case ${DestLib} in
       ##############
       ${UnixMods})
       ##############
          godir ${SourceFusr}/${SourceLib}/SRC
          ;;
       ##############
       ${WinMods})
       ##############
          #
          # stack ftp commands to get the files from the NT server
          #
          /usr/bin/ftp -i ${NTPC} << GET-EOF
          ascii
          mget ${SourceFusr}/${E_Devel}/${SourceLib}/src/*
          bye
GET-EOF
          ;;
       ##############
        *)
       ##############
          print "Unidentified Destination library: ${DestLib}"
          exit 1
          ;;
  esac
# <more code here, not important>

Quote:} # function buildlib

Any help would be appreciated.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Embedded FTP commands in Case statement problem

Is it possible to nest a set of FTP commands in a case statement?
I cannot get this portion of my script to function.  The korn shell
returns the following message:  "Syntax error at line 102 : `<' is not
matched"

#########################################################
function buildlib {
#########################################################
  if [[ $# != 3 ]];then
    print "${0} called with bad number of parameters -- terminating"
    exit 1
  fi
  DestLib=${1}
  SourceFusr=${2}
  SourceLib=${3}

  # Check for Unix or Windows
  case ${DestLib} in
       ##############
       ${UnixMods})
       ##############
          godir ${SourceFusr}/${SourceLib}/SRC
          ;;
       ##############
       ${WinMods})
       ##############
          #
          # stack ftp commands to get the files from the NT server
          #
          /usr/bin/ftp -i ${NTPC} << GET-EOF
          ascii
          mget ${SourceFusr}/${E_Devel}/${SourceLib}/src/*
          bye
GET-EOF
          ;;
       ##############
        *)
       ##############
          print "Unidentified Destination library: ${DestLib}"
          exit 1
          ;;
  esac
# <more code here, not important>

Any help would be appreciated.

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Solaris 2.6 adb problem.....

3. function and case statement help request...

4. named help

5. supraexpress modems (28.8) problems w/dial-ins

6. Info? Is there a file listin RPM contents for RH50?

7. Netscape plug-ins problem

8. FreeBSD and NATD

9. Problems with dialing out when dial-ins are enabled

10. Netscape 4.51 and plug-ins problem

11. In search of Solaris 2.5 Netscape Navigator 3.0 plug ins

12. Need HELP to Log User Log-ins form the internet

13. Suse 7.0; Yast2, kinternet, rc.dialout und ich komme nicht ins Internet