Executing CR HOST script, encountering command not found

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

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.

Similar Messages

  • Command not found error while executing a shell script

    Hello,
    I am a newbie to linux.I am attaching the code which gives me following errors..
    error list:
    1. no such file or directory enviornemnt
    2. command not found
    3. ambiguous redirectline
    Script
    cd $HOME/wkdir
    rm /tmp/*.log
    # source environment
    . ./env
    # Run the install script to setup the database
    # Configure SH account
    sqlplus "/ as sysdba" <<! > /tmp/perflab_install.log 2>&1
    grant connect, resource, dba to SH;
    alter user sh account unlock;
    # create the fetch_n_rows procedure
    sqlplus "$PERFLAB_USER" <<! >> /tmp/perflab_install.log 2>&1
    drop index sales_time_bix;
    drop index sales_time_idx;
    create index sales_time_idx on sales(time_id) compute statistics;
    -- fetch_n_rows: fetches 'n' rows from the specified statement --
    CREATE OR REPLACE PROCEDURE fetch_n_rows(
    stmt VARCHAR,
    name VARCHAR,
    nexec NUMBER := 1,
    nrows NUMBER := 0,
    debug BOOLEAN := FALSE)
    IS
    -- Local variables
    curs INTEGER := null;
    rc INTEGER;
    nexec_it INTEGER := 0;
    nrows_it INTEGER;
    BEGIN
    dbms_application_info.set_module('DEMO', name);
    WHILE (nexec_it < nexec)
    LOOP
    curs := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(curs, stmt, DBMS_SQL.NATIVE);
    rc := DBMS_SQL.EXECUTE(curs);
    nrows_it := 0;
    LOOP
    IF (dbms_sql.fetch_rows(curs) <= 0 OR (nrows <> 0 AND nrows_it = nrows
    THEN
    EXIT;
    ELSE IF (debug = TRUE)
    THEN
    DBMS_OUTPUT.PUT_LINE(nrows_it);
    END IF;
    END IF;
    nrows_it := nrows_it + 1;
    END LOOP;
    DBMS_SQL.CLOSE_CURSOR(curs);
    nexec_it := nexec_it + 1;
    END LOOP;
    dbms_application_info.set_module(null, null);
    END fetch_n_rows;
    show errors
    # Start the workload
    . ./start_workload.sh > /tmp/setup_perflab.log 2>&1
    # Wait two minutes for workload to get going
    sleep 120
    # Modify snapshot interval
    sqlplus -s /NOLOG <<EOF >> /tmp/setup_perflab.log 2>&1
    connect / as sysdba
    set head on
    set feedback on;
    set pagesize 40
    rem -- event to allow setting very short Flushing interval
    alter session set events '13508 trace name context forever, level 1';
    rem -- change INTERVAL setting to 2 minutes
    rem -- change RETENTION setting to 6 hours (total of 180 snapshots)
    execute dbms_workload_repository.modify_snapshot_settings(interval => 2,-
    retention => 360);
    EOF
    Note : start_workload.sh is also in the same directory..
    Any help would be greatly appreciated.

    Please put your script between "code" format delimiters.
    http://wiki.oracle.com/page/Oracle+Discussion+Forums+FAQ
    You can add the line "set -x" at the beginning of your script to see at which line it fails? I suspect the . ./env line.

  • Command not found error while executing shell programs in terminal

    I have written one sample shell program.
    while executing shell program in terminal,it shows COMMAND NOT FOUND error.
    How to slove this.

    Post the "Actual" error.  It says more than command not found.
    Post your script.
    Post the output from:
    echo $PATH
    Post the output from:
    which name_of_command_not_found

  • Automtor shell script "command not found"

    I want to include the execution of a shell script in Automator. The script just executes a third-party application (actually, pdftk) with certain parameters. I have written the script, saved it in my Home directory as "foo.sh", made it executable, and can correctly call it from Terminal with ./foo.sh. It works as expected.
    But if I include it in Automator's workflow, into action "Run shell script", its execution breaks complaining that "pdftk: command not found". This indicates that the script is correctly found and read by Automator. How is it, that Terminal's bash can find the command, but Automator doesn't ? Have commands to be written in a special way to be understood by Automator ? Perhaps third-party commands are not allowed in Automator ?

    As twtwtw has said, you environment when running Automator is NOT the same as when you are in a Terminal session.
    pwd:
    /Users/harris
    /bin/ls -dlaeO@ .
    drwxr-xr-x  349 harris  harris  - 11866 Mar 14 22:06 .
    id -a:  uid=501(harris)
    gid=501(harris)
    groups=501(harris),
    204(_developer),
    100(_lpoperator),
    98(_lpadmin),
    80(admin),
    61(localaccounts),
    12(everyone)
    $# 0
    printenv: SHELL=/bin/bash
    TMPDIR=/var/folders/zv/zvU6+bMiHTeElG+JIWOdzk+++TI/-Tmp-/
    Apple_PubSub_Socket_Render=/tmp/launch-rVMvHQ/Render
    USER=harris
    COMMAND_MODE=unix2003
    SSH_AUTH_SOCK=/tmp/launch-fH4Gt7/Listeners
    __CF_USER_TEXT_ENCODING=0x1F5:0:0
    PATH=/usr/bin:/bin:/usr/sbin:/sbin
    PWD=/Users/harris
    DBUS_LAUNCHD_SESSION_BUS_SOCKET=/tmp/launch-RIPIu6/unix_domain_listener
    SHLVL=1
    HOME=/Users/harris
    LOGNAME=harris
    DISPLAY=/tmp/launch-ttdbVO/org.x:0
    FRED=3-Mar-2009
    _=/usr/bin/printenv

  • I am trying to install oracle 11g xe on ubuntu aws instance when i execute sudo /etc/init.d/oracle-xe configure command iam getting this error: sudo: /etc/init.d/oracle-xe : command not found

    i am trying to install oracle 11g xe on ubuntu aws instance when i execute sudo /etc/init.d/oracle-xe configure command iam getting this error: sudo: /etc/init.d/oracle-xe : command not found.

    "command not found" means ... there is no such thing.
    Has the .rpm been installed?
    http://docs.oracle.com/cd/E17781_01/install.112/e18802/toc.htm#XEINL122

  • I have this message on Terminal. nano/private/etc/hosts: command not found. How can I fix it to get right?

    /etc/hosts ; exit;
    /etc/hosts: line 7: 127.0.0.1: command not found
    /etc/hosts: line 8: 255.255.255.255: command not found
    /etc/hosts: line 9: ::1: command not found
    logout

    What are you attempting to do?

  • 'java_wrapper: command not found'  when running license script

    Hello, am trying to run a third party application licensing script which needs JRE to run. This script is failing with the following error. 'java_wrapper: command not found' ...
    Can anyone assist with ideas of resolution?! Does a path need to be set? Does JRE (1.4.1_x) need to live in a specific part of the unix filesystem (solaris 8)?!
    Thanks!!

    This is not a TNS names issue if you can connect to database. It could be a network problem, but more likely it's a problem with the installation of the app server. When you install the app server, it should use the name assigned to the server. I don't believe you can just make up a name for an app server unless it is known to the network.

  • [SOLVED] command not found when chrooted into Debian

    I have used Debian previously. I have a debian chroot on a separate partition which sole purpose is apache2 server. I use apache2 in chroot, so everytime I reinstall my main system, all my projects are left there in this system untouched. The chroot was created with Debian's debootstrap. Now when I moved from Debian to Arch, I can't use this chroot. When I chroot into it I can't execute any command there, all I get is command not found, even on things such as ls, rm, mv.
    Does it mean that I have to create a chroot for server again, using Arch linux or is there a way to get this Debian working?
    Last edited by kox (2015-05-02 20:13:22)

    I don't think the `arch-chroot` script will work for a Debian system but I could be wrong.
    Have you tried mounting /proc, /sys & /dev first and sourcing the shell profiles afterwards?
    https://wiki.archlinux.org/index.php/Ch … ing_chroot
    This shouldn't make any difference as the chroot fstab should already have entries for these but you never know...
    Maybe you should copy /etc/hosts & /proc/mounts from your new Arch system into your Debian chroot.
    https://wiki.debian.org/Debootstrap
    @WorMzy -- the shell built-ins are not working so I don't think it's a $PATH issue.
    Last edited by Head_on_a_Stick (2015-05-02 19:41:44)

  • QSH command not found

    We Noticed the a problem on our v5R4 iseries after an IPL this weekend
    in both our development system and production system.
    If I try to start JSPM via:
    QSH CMD('/usr/sap/rp1/DVEBMGS00/j2ee/JSPM/go')  get an error
    go command not found.
    If I try to start the SDM via
    ./StartServer.sh ;   get the same error command not found
    I can do a java -version  with qsh and get a result  java
    version "1.4.2";
    Tried using the go from 885063 and sidadm is the owner
    Does anyone have any idea's how to resolve this issue or other test to
    run.
    qsh: 001-0014 Command /usr/sap/rp1/DVEBMGS00/j2ee/JSPM/go not found.
    Press ENTER to end terminal session.
    Regards,
    Brian

    Hi Brian,
    ideas for debugging that issue: put an "echo test" into the first line of the go script. If you then see the echo output you'll know that at least the script was executed. Then one would have to debug into the script. If not even the echo is done, it is maybe a good idea to check the authorities along the path to the go script. You can do that by creating a little test script (with the same authorities as go) which just echoes something and try to place it in the directories further up the path.
    IF nothing helps you might want to consider opening a ticket at SAP?
    BR,
    Christoph

  • Lsnrctl: command not found while restoring the cold clone 11i 11gr2 instan

    Dear Experts,
    We have noted few errors while doing the Clonning of our production instance.
    1. We have upgraded our production instance database from 9i to 11gr2 using the latest interoperablity note id.
    2. When trying to restore the instance we are getting the below error. We have noted that our database is up and running but when i manually tried to restore the instance we are gettting the below error.
    bash: lsnrctl: command not found
    Please note that when ever we are clonning the instance from source to target we have noted that lsnrctl command is missing from the oracle_home/bin folder ?
    Is that a bug in 11gr2 with 11i instance.?
    3. Please find the attach log files of the clone and advise ASAP.
    Regards
    Mohammed.

    [root@oracle JCLONE_oracle]# vi ApplyDBTier_11151230.log
    sDbPort : 1524
    sDbSid : JCLONE
    sDbUser : apps
    Trying to connect using SID...
    getConnectionUsingSID() -->
    JDBC URL: jdbc:oracle:thin:@oracle.jtl.co.ke:1524:JCLONE
    Exception occurred: java.sql.SQLException: IO Error: The Network Adapter could not establish the connection
    Trying to connect using SID as ServiceName
    getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.jtl.co.ke)(PORT=1524))(CONNECT_DATA=(SERVICE_NAME=JCLONE)))
    Exception occurred: java.sql.SQLException: IO Error: The Network Adapter could not establish the connection
    Trying to connect using SID as ServiceName.DomainName
    getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.jtl.co.ke)(PORT=1524))(CONNECT_DATA=(SERVICE_NAME=JCLONE.jtl.co.ke)))
    Exception occurred: java.sql.SQLException: IO Error: The Network Adapter could not establish the connection
    Connection could not be obtained; returning null
    -------------------ADX Database Utility Finished---------------
    RC-00118: Error occurred during creation of database
    Raised by oracle.apps.ad.clone.ApplyDatabase
    StackTrace:
    java.lang.Exception: Control file creation failed
    at oracle.apps.ad.clone.ApplyDatabase.<init>(ApplyDatabase.java:661)
    at oracle.apps.ad.clone.ApplyDatabase.<init>(ApplyDatabase.java:328)
    at oracle.apps.ad.clone.ApplyDatabase.<init>(ApplyDatabase.java:304)
    at oracle.apps.ad.clone.ApplyDBTier.<init>(ApplyDBTier.java:154)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
    at oracle.apps.ad.clone.util.CloneProcessor.run(CloneProcessor.java:68)
    at java.lang.Thread.run(Thread.java:595)
    Errors in file /u04/d01/tech_st/11.2.0/admin/JCLONE_oracle/diag/rdbms/jclone/JCLONE/trace/JCLONE_ora_13528.trc:
    ORA-00367: checksum error in log file header
    ORA-00305: log 1 of thread 1 inconsistent; belongs to another database
    ORA-00312: online log 1 thread 1: '/u04/d01/apps_st/data/log01a.dbf'
    Clearing online redo logfile 1 complete
    Clearing online redo logfile 2 /u04/d01/apps_st/data/log02a.dbf
    Clearing online log 2 of thread 1 sequence number 0
    Errors in file /u04/d01/tech_st/11.2.0/admin/JCLONE_oracle/diag/rdbms/jclone/JCLONE/trace/JCLONE_ora_13528.trc:
    ORA-00367: checksum error in log file header
    ORA-00305: log 2 of thread 1 inconsistent; belongs to another database
    ORA-00312: online log 2 thread 1: '/u04/d01/apps_st/data/log02a.dbf'
    addlnctl.txt
    /u04/d01/tech_st/11.2.0/appsutil/scripts/JCLONE_oracle/addlnctl.sh: line 96: lsnrctl: command not found
    /u04/d01/tech_st/11.2.0/appsutil/scripts/JCLONE_oracle/addlnctl.sh: line 111: lsnrctl: command not found
    addlnctl_tmp.txt
    /u04/d01/tech_st/11.2.0/appsutil/scripts/JCLONE_oracle/addlnctl.sh: line 111: lsnrctl: command not found

  • Crontab "Desktop: command not found"

    This is my first attempt to use crontab. I have a working shell script, humassetsmonupload, in my /Users/Shared/ directory that when I run it without arguments, it does as expected.
    I've made my first edit in crontab by adding this line:
    */10 * * * * * /Users/Shared/humassetsmonupload
    According to my system mail messages, crontab is alerting me every ten minutes about it. But all messages say this:
    /bin/sh: Desktop: command not found
    The shebang matches it. The environment is correct it appears. But "Desktop" throws me. The shell script does not have this word in it. What am I overlooking?, sam

    1st, you have too many * in your "When to Run" section. There are ONLY 5 fields. You have 6.
    So that 6th field is actually treated as the first word of your command to execute. So you are trying to execute:
    * /Users/Shared/humassetsmonupload
    as your command. The * is going to list every file in your home directory, and if Desktop is the first name listed, then the shell is going to try and execute the command Desktop.
    2nd, another thing to keep in mind. You do not have your full set of environment variables when running via cron.
    It is useful to run a cron job that does a printenv
    */10 * * * * printenv >/tmp/cron.printenv
    after you have your list of cron available environment variables, you can remote the printenv entry.

  • -bash:  cat: command not found (or grep)

    Hi, Strange things:
    i3: okn$ ls -R | grep -h "dof" | cat > dtext.txt
    -bash:  cat: command not found
    or then I get this:
    i3: okn$ find . -type f -print | grep -c
    -bash:  grep: command not found
    but this is not happening all the time, i remember grep or cat did work once or twice...
    What's going on here?
    OS 10.7.4; repaired permissions
    Any assistance much appreciated!
    / bw, Omar KN

    'cat' is stored in /bin/cat, NOT /usr/bin/cat, which explains the file not found messages above.
    HOWEVER, the information you have provided seems to imply you have the executables, and previous information provides says you have a valid PATH:
    echo $PATH
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/bin:/bin:/usr/sbi n:/sbin:/usr/local/bin:/usr/X11/bin
    this creates a mystery as to why you are getting:
    -bash:  cat: command not found
    -bash:  grep: command not found
    I have a couple of thoughts.
    a) I'm wondering if you have any 'alias' statements in your .bash_profile (or .bash_login, or .profile, or .bashrc).
    b) if you would get the same results should you rename your .bash_profile (and/or .bash_login, .profile, .bashrc) to something like saved.bash_profile, then restart your terminal session (basically eliminating any personalized shell customization).
    c) what would happen if you created a new account (System Preferences -> Accounts) - basically a clean starting point.
    d) are you executing these commands from the command prompt?  Or from within a shell script?
    d.1) if from within a shell script, is the script file the correct file format.
    file name.shell.script
    you want to check that the output from the 'file' command DOES NOT say "...with CRLF line terminators...", as that would imply the the file came from (or through) a Windows system.

  • Bash: adb: command not found.

    I installed ADT bundle from Google.
    I navigated to
    ~/adt-bundle-linux-x86_64-20130219/sdk/platform-tools
    I tried to start adb and got.
    bash: adb: command not found.
    Grrrrr. Had this issue on Debian half a year before. Installed ia32-libs back-then. It worked.
    Arch has no ia32-libs. Uncommented multilib and installed
    lib32-gcc-libs-4.8.0-2 lib32-glibc-2.17-5 lib32-libstdc++5-3.3.6-6 lib32-ncurses-5.9-2
    Like suggested in the forum. No change. Adb is still not found.
    Any help?
    Last edited by manuelschneid3r (2013-04-22 18:21:58)

    manuelschneid3r wrote:
    I tried a lot distros, but I still would not call me an advanced user. I dont know exactly the dfference but ./foo runs something that has rights to be executed. Yes I called it in the right directory. Its a linking problem. (See here)
    I installed the dependencies of android from AUR. Now it works but it shows ??????????? as device...
    Incredibly sick, that Android SDK is not in the official repos...
    The "????????????" means that you do not have the correct udev rules setup. There's an adb udev rules package to install to get around having to write your own.
    And no, `./script.sh` executes something in the present working directory. It is equivalent to:
    $ $SHELL $(pwd)/script.sh
    All the best,
    -HG

  • Startssap command not found

    My linux system does not find the startsap command, although it is located in /SAP/NW4/exe .I am new to this forum and to linux and I need some  advice. Thank you very much in advance.
    Hardware :      AMD Athlon 64 , 512 MD Ram
    Linux Version : Suse 9.3 enterprise
    Sap software :     Sap NetWeaver 4.0 DVD Sept 2004, SAP Web AS 6.4 for Linux (trial/ Version)
    data base :     Max_DB Vers 7.590 day trial Version
    SID:          NW4
    0.) checked PATH
    1.) I followed the instructions given by the instruction file install.html. After starting the shellscript install.sh . I get the following output of the script:
         package sapj2ee-servsapdb-6.40-2 is installed
         package sapdb-7.5-2 is installed
         package sapdb-db-log-7.5-2 is installed
         found interface: inet.alisa is inet : 0
         ifconfig inet: 0 195.155.155.1 up
         SIOCSIFADDR : no such device
         inet : 0 unknown interface
         inet : 0 unknown interface
         ok
    2.)I configured the network:  ifconfig eth0:0 195.155.155.1 and etc/hosts nw4host 195.155.155.1
    3.)Installation of the license package . How to check the result ?
    4.)User nw4adm : startsxap nw4host => command not found
    kind regards fritz nonnenbruch<b></b><b></b>

    Checked and updated path in etc/profile
    problem solved

  • Compile smartmontools pkg from terminal: command not found

    hi there!
    when i comiple tar.gz packages i usally install it by this way:
      cd smartmontools-6.0
      ./configure
      make
      sudo make install
    everythink ok but when i prompt:
    smartctl /dev/disk1s2
    i see the error: command not found
    whats wrong? i googled it up and it seems that the command isnt in the system path but cant find to fix it!
    is a smartctl specific problem or after compiling/install am i missing something?
    thanks
    Enrico
    (osx: 10.8.2)

    Open Source installers DO NOT mess with individual user shell initialization scripts.  Open Source project may be installed on single user systems, or multi-user systems so to update every possible user's shell initialization files becomes a nightmare.   For example which accounts should be updated, and which are daemon accounts that should be left along.  Which shell does the user of each account prefer to use?  And for some shells, there are multiple different shell initialzation files, so which one does the shell initialzation file select.  And if the user already has a PATH environment variable in a shell initializaton file that gets executed AFTER the file the installer choose (.bash_profile vs .bashrc), then all the installers work would be for nothing, and worse confuse the user. And the user already has the directory in PATH, but they are not logged in, does the installer parse all the other user's shell initialzation files to figure out if that user does not need an update PATH, or does it blindly add yet another export PATH to one of the shell initialization files?
    Open Source installers worry about the getting the app built and installed.  It leaves the user's personal files alone, for very good reasons :-)

Maybe you are looking for

  • I installed CS3 from backup to a new iMac when my old iMac failed.  How do I activate CS3 suite?

    I installed CS3 from backup to a new iMac when my old iMac failed.  How do I activate CS3 suite? When I try starting Photoshop, for example, it tells me uninstall then reinstall the product OR contact product support. However, when I phone product su

  • Trouble with iPod setting screen

    Right, Ive got all my music on my 5G 30gb iPod, the problem is, I also have a movie I want to put onto my iPod but Im not having much luck with it. I successfully coded the movie using HandBrake, and its currently under "movies" in my library. Howeve

  • Up-grading to CS5 and about actions and plug-ins

    Is there a fast, easy way to import my actions and additional plug-ins from my CS4 photoshop to my new upgraded CS5 photoshop.  Or do I have to install them all over, individually?  HELP!

  • Need Help on Integration between OAM - IAM

    Hi, Any one Please Share me the Documents related to Integration between OAM - IAM. Regards, Sai.

  • Loading entire photos library crashes

    The issue is the when I attempt to load my entire photo library from my iMac it crashes and goes back to the home screen. I am running up to date versions on all OS's and events and smaller albums in iPhoto or individual albums in finder all work fin