rsh cannot find executable - Unix

This is a discussion on rsh cannot find executable - Unix ; I have an executable under my /home/user1/bin, and i added /home/ user1/bin to my PATH when i am executing it under user1, everything is fine. user1> exec1 ... ok I made sure rsh works: user1> rsh mymachine date Mon Jul ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: rsh cannot find executable

  1. rsh cannot find executable

    I have an executable under my /home/user1/bin, and i added /home/
    user1/bin to my PATH

    when i am executing it under user1, everything is fine.

    user1> exec1
    ... ok

    I made sure rsh works:

    user1> rsh mymachine date
    Mon Jul 7 14:32:09 CDT 2008


    However when running exec1 with rsh, it says can't fine executable:


    user1> rsh mymachine exec1
    ksh: exec1: not found.

    How can i fix that? thanks



  2. Re: rsh cannot find executable

    "uwcssa@gmail.com" writes:
    >I have an executable under my /home/user1/bin, and i added /home/
    >user1/bin to my PATH


    How and where did you add "/home/user1/bin" to your PATH?


    > However when running exec1 with rsh, it says can't fine executable:
    >
    >
    > user1> rsh mymachine exec1


    Because it is not in the PATH that rsh is using, so you need to tell
    us "how and where" you set the PATH environment variable.

    scott

  3. Re: rsh cannot find executable

    uwcssa@gmail.com wrote:
    > I have an executable under my /home/user1/bin, and i added /home/
    > user1/bin to my PATH


    How did you set it? Manually on the command line or by putting it
    in the start-up file for you shell?

    > when i am executing it under user1, everything is fine.


    > user1> exec1
    > ... ok


    > I made sure rsh works:


    > user1> rsh mymachine date
    > Mon Jul 7 14:32:09 CDT 2008


    Well, date is a command that's in the default PATH

    > However when running exec1 with rsh, it says can't fine executable:


    > user1> rsh mymachine exec1
    > ksh: exec1: not found.


    > How can i fix that?


    Looks like you set PATH only for the shell you're just running.
    But if you use rsh a new shell gets started on the remote machine
    that doesn't know anything about the shell currently running
    locally - and it won't inherit its PATH from the running shell
    since it's a shell on a remote machine (even though it's in this
    case the same machine).

    Put the setting of PATH in your .bashrc (or whatever is the
    start-up file of the shell you're running) and you should be
    fine. Or set PATH explicitely when calling 'exec1', i.e.

    rsh mymachine PATH=/home/user1/bin exec1

    or do

    rsh mymachine PATH=$PATH exec1

    to set PATH to a copy of what's set in the shell you're using
    to start rsh.
    Regards, Jens
    --
    \ Jens Thoms Toerring ___ jt@toerring.de
    \__________________________ http://toerring.de

+ Reply to Thread