2 Replies Latest reply on Jul 17, 2006 8:05 AM by cmyck

    fdb shell script is broken

    cmyck Level 1
      Hi all,

      My copy of fdb shell script in the /bin dir of the SDK was fubar. Calling it yielded:
      G5:/Developer/SDKs/Flex/bin cmyk$ sh fdb
      : command not found
      : command not found
      'db: line 8: syntax error near unexpected token `in
      'db: line 8: `case `uname` in

      I'm not much of a shell scripter. But I was able to make it work using the mxmlc script.
      Here's the corrected source:

      #!/bin/sh

      #
      # fdb launch script for unix. On windows, fdb.exe is used and
      # java settings are managed in jvm.config in this directory.
      #

      case `uname` in
      CYGWIN*)
      OS="Windows"
      ;;
      *)
      OS=Unix
      esac

      if [ $OS = "Windows" ]; then
      # set FLEX_HOME relative to mxmlc if not set
      test "$FLEX_HOME" = "" && {
      FLEX_HOME=`dirname $0`/..
      FLEX_HOME=`cygpath -m $FLEX_HOME`
      }

      elif [ $OS = "Unix" ]; then

      # set FLEX_HOME relative to mxmlc if not set
      test "$FLEX_HOME" = "" && {
      FLEX_HOME=`dirname $0`/..
      }

      fi

      VMARGS="-Dapplication.home=$FLEX_HOME -Xmx384m"

      java $VMARGS -jar $FLEX_HOME/lib/fdb.jar $*


      Cheers,
      Phil


        • 1. Re: fdb shell script is broken
          Level 7
          The issue is the line endings in fdb are dos carriage return/line feeds. The
          workaround is convert the line endings in the script. This can be easily
          accomplished using one of the following commands:

          dos2unix -o fdb
          or something like the following command:
          cat fdb | tr -d '\r' > fdb

          -brent

          "cmyck" <webforumsuser@macromedia.com> wrote in message
          news:e9e88m$n43$1@forums.macromedia.com...
          > Hi all,
          >
          > My copy of fdb shell script in the /bin dir of the SDK was fubar. Calling
          > it
          > yielded:
          > G5:/Developer/SDKs/Flex/bin cmyk$ sh fdb
          > : command not found
          > : command not found
          > 'db: line 8: syntax error near unexpected token `in
          > 'db: line 8: `case `uname` in
          >
          > I'm not much of a shell scripter. But I was able to make it work using the
          > mxmlc script.
          > Here's the corrected source:
          >
          > #!/bin/sh
          >
          > #
          > # fdb launch script for unix. On windows, fdb.exe is used and
          > # java settings are managed in jvm.config in this directory.
          > #
          >
          > case `uname` in
          > CYGWIN*)
          > OS="Windows"
          > ;;
          > *)
          > OS=Unix
          > esac
          >
          > if [ $OS = "Windows" ]; then
          > # set FLEX_HOME relative to mxmlc if not set
          > test "$FLEX_HOME" = "" && {
          > FLEX_HOME=`dirname $0`/..
          > FLEX_HOME=`cygpath -m $FLEX_HOME`
          > }
          >
          > elif [ $OS = "Unix" ]; then
          >
          > # set FLEX_HOME relative to mxmlc if not set
          > test "$FLEX_HOME" = "" && {
          > FLEX_HOME=`dirname $0`/..
          > }
          >
          > fi
          >
          > VMARGS="-Dapplication.home=$FLEX_HOME -Xmx384m"
          >
          > java $VMARGS -jar $FLEX_HOME/lib/fdb.jar $*
          >
          >
          > Cheers,
          > Phil
          >
          >
          >
          >


          • 2. Re: fdb shell script is broken
            cmyck Level 1
            Thanks Brent,

            I suspected something like that.
            The original also had redundant lines of code in it.
            This was used twice:
            VMARGS="-Dapplication.home=$FLEX_HOME -Xmx384m"
            java $VMARGS -jar $FLEX_HOME/lib/fdb.jar $*

            Cheers,
            Phil