13 Replies Latest reply on Dec 16, 2010 10:18 AM by user13004761

    Executing CR HOST script, encountering command not found

    LBradley
      Hi All,

      I new to writing Host scripts, especially for use within the Applications.
      I need to go out to an FTP site and grab a file.

      The FTP portion of the script works fine.
      The problem I'm encountering is with the execution of regular commands like 'cd' or 'mv'.
      The error comes back, ...line xx: cd: command not found
      When I have an actual directory path with the cd command - I always get, No such file or directory...
      (I have verified the directory paths I'm attempting to change to exist and available.)

      The FTP portion executes, but the received file goes into some obscure server directory. Can't even perform a move of the file.
      The echo command works fine.
      I have created just a dummy script to do a cd /u32/... command and still the same Error.

      Any suggestions will be very helpful.

      Thanks,

      Bradley
        • 1. Re: Executing CR HOST script, encountering command not found
          Hussein Sawwan-Oracle
          Hi,

          Can you post the code here?

          Regards,
          Hussein
          • 2. Re: Executing CR HOST script, encountering command not found
            669464
            hi,

            use lcd command to go in the local directory(on local host) get the file from remote host that file will be in the local directory and use cd command to go in directories on remote host.

            That means simple lcd as cd on local host and cd on remote host,Hope u understand

            Regards
            • 3. Re: Executing CR HOST script, encountering command not found
              LBradley
              Here is a main code script....

              #$HEADER: XX_BANK_STMTS_IMPORT
              ##########################################################################
              #
              # PROGRAM NAME: XX_BANK_STMTS_IMPORT
              #
              # PURPOSE:
              # Load XXXX Bank Statements
              #
              # XX Bank Statements Import Concurrent Program
              #
              # This script requires to run as Concurrent Request
              #
              P_LOGIN="$1"
              P_USER_ID="$3"
              P_REQUEST_ID="$4"
              #
              REMOTE_USER=ftpuser
              REMOTE_PASSWD=ftpuser
              FTP_DIR=u32/oracle/DBCTEST/apps/apps_st/xxcust/12.0.0/ftp/inbound
              REMOTE_PATH=public/dbco_cng/reporting
              REMOTE_FILE=*.PGP
              echo "USER = "${USER}
              echo "HOST = "${HOSTNAME}
              echo "Directory = "${PWD}
              cd /u32/oracle/XXXTEST/apps/apps_st/appl/xxcust/12.0.0/ftp/inbound
              echo "Directory = "${PWD}
              echo " Transferring File"
              ftp -n -i -v <<-EOF
              open XX.XX.XXX.XXX
              user $REMOTE_USER $REMOTE_PASSWD
              ##lcd $FTP_DIR
              cd $REMOTE_PATH
              mget $REMOTE_FILE
              EOF


              --
              I get errors like
              /u32/oracle/XXXTEST/apps/apps_st/appl/xxcust/12.0.0/bin/XX_BANKFILE_LOAD.prog: line 108: cd: /u32/oracle/XXXTEST/apps/apps_st/appl/xxcust/12.0.0/ftp/inbound
              : No such file or directory

              or if I just put the cd command:
              cd: commad not found

              The commented out lcd was from previous tries at doing it that way... No luck.

              Thanks.
              • 4. Re: Executing CR HOST script, encountering command not found
                LBradley
                Hungry DBA,

                Thanks and yes I understand.. I read about this option the other day.
                I have tried it the way you suggested before - with no luck.

                Whats strange (at least for me) is the cd $REMOTE_PATH within the FTP session of the script works fine.
                I started thinking could it be an environment setting or something - not recognizing the commands?


                Thanks,

                Bradley
                • 5. Re: Executing CR HOST script, encountering command not found
                  Srini Chavali-Oracle
                  Pl identify which shell you are using. For ksh, a "set -x" command as the first line provides debugging output that could be useful.

                  Pl also add an "echo $PATH" statement near the beginning of the script to verify PATH values. Typically, standard Unix command executables are located in "/usr/bin" and this needs to be included in the PATH variable.

                  HTH
                  Srini
                  • 6. Re: Executing CR HOST script, encountering command not found
                    Hussein Sawwan-Oracle
                    Hi,
                    The error comes back, ...line xx: cd: command not found
                    When I have an actual directory path with the cd command - I always get, No such file or directory...
                    Do you get the same error if you type the full path of the OS commands?

                    Regards,
                    Hussein
                    • 7. Re: Executing CR HOST script, encountering command not found
                      580352
                      Hi Bradley,

                      Can you please let us know more about the server which you are trying to connect like Server OS, Make etc
                      This may give few clues.

                      Thanks
                      Shailendra
                      • 8. Re: Executing CR HOST script, encountering command not found
                        LBradley
                        All,

                        When I place the #! /usr/bash or /usr/ksh at the start of the script I get the following error:

                        FND-CP-ESP: Child: exec:: No such file or directory

                        (I researched this error some and forwarded some of the Server suggestions to the Sys Admin team... but still nothing)

                        For the echo of ${PATH} I get the following:

                        Directory = /u32/oracle/ACMETEST/apps/tech_st/10.1.3/perl/bin:/u32/oracle/ACMETEST/apps/tech_st/10.1.2/bin:/u32/oracle/ACMETEST/apps/apps_st/appl/fnd/12.0.0/bin:/u32/oracle/ACMETEST/apps/apps_st/appl/ad/12.0.0/bin:/u32/oracle/ACMETEST/apps/tech_st/10.1.3/appsutil/jdk/jre/bin:/u32/oracle/ACMETEST/apps/apps_st/comn/util/unzip/unzip::/u32/oracle/ACMETEST/apps/tech_st/10.1.2/bin:/usr/bin:/usr/sbin:/u32/oracle/ACMETEST/apps/tech_st/10.1.3/appsutil/jdk/jre/bin:/usr/bin:/usr/ccs/bin:/bin:/u32/oracle/ACMETEST/apps/tech_st/10.1.3/appsutil/jdk/bin:/u32/oracle

                        The set [-x] didnt seem to provide any feedback.



                        Thanks for all your responses thus far!


                        Bradley
                        • 9. Re: Executing CR HOST script, encountering command not found
                          Srini Chavali-Oracle
                          >
                          When I place the #! /usr/bash or /usr/ksh at the start of the script I get the following error:
                          >

                          There should be no space between the "!" and the following "/" - it should read "#!/usr/ksh"

                          >
                          For the echo of ${PATH} I get the following:
                          >

                          Are you doing an "echo $PATH" at the command line or is this output from the actual "echo $PATH" in the script ?

                          The two may not necessarily be the same.

                          HTH
                          Srini
                          • 10. Re: Executing CR HOST script, encountering command not found
                            LBradley
                            I have tried it (#!/bin/ksh and #!/bin/bah) with and w/o the space... Same error

                            FND-CP-ESP: Child: exec:: No such file or directory
                            /u32/oracle/ACMETEST/apps/apps_st/appl/xxcust/12.0.0/bin/ACME_COMA_BANKFILE_LOAD
                            Program exited with status 1

                            The echo $PATH info I provided was from withing the script execution.

                            Here is the $PATh info from the command line:

                            /usr/kerberos/bin:/usr/local/bin/:/bin:/usr/bin:/home/ftpuser/bin



                            Thanks!
                            • 11. Re: Executing CR HOST script, encountering command not found
                              Srini Chavali-Oracle
                              >
                              FND-CP-ESP: Child: exec:: No such file or directory
                              /u32/oracle/ACMETEST/apps/apps_st/appl/xxcust/12.0.0/bin/ACME_COMA_BANKFILE_LOAD
                              >

                              Does the file "/u32/oracle/ACMETEST/apps/apps_st/appl/xxcust/12.0.0/bin/ACME_COMA_BANKFILE_LOAD.prog" exist ? Has it been softlinked to $FND_TOP/bin/fndcpesr ?

                              MOS Doc 156636.1 - How to Register a Host Concurrent Program in Applications

                              HTH
                              Srini
                              • 12. Re: Executing CR HOST script, encountering command not found
                                LBradley
                                Yes the path and file does exist and all the permissions appear to be set.
                                The system guys said the link was created and I do see a reference to fnd/12.0.0/bin/fndcpesr in the XXCUST/12.0.0/bin

                                in directory: /u32/oracle/ACMETEST/apps/apps_st/appl/xxcust/12.0.0/bin

                                I have (.prog)
                                XXACME_COMA_BANKFILE_LOAD.prog

                                and this

                                XXACME_COMA_BANKFILE_LOAD -> /u32/oracle/ACMETEST/apps/apps_st/appl/fnd/12.0.0/bin/fndcpser


                                Thanks.
                                • 13. Re: Executing CR HOST script, encountering command not found
                                  user13004761
                                  Hi,
                                  FND-CP-ESP: Child: exec:: No such file or directory
                                  Once I have met the same message you met.

                                  In my case the cause is the code of "End of Line", which differs between Unix and Win.

                                  The line #!/bin/sh in the shell script ends hidden carrige return (CR) which is a part of "End of Line" code in Win, but not in Unix. Yes, the script is edited in Win, not Unix.

                                  So when executing the shell script, shell searched is not-existing /bin/sh(CR), not /bin/sh. This causes the error message in my case.

                                  Regards,