rsh & perl -Directory creation not possible

Discussion in 'Perl Misc' started by qazmlp, Oct 21, 2003.

  1. qazmlp

    qazmlp Guest

    I have a perl script which creates a directory in the local machine.
    But, if I call this script from the remote machine using rsh, the
    directory is not created. And there is no error message reported. Why
    is that so ?

    What is the remedy for this ?
    qazmlp, Oct 21, 2003
    #1
    1. Advertising

  2. It was a dark and stormy night, and qazmlp managed to scribble:

    > I have a perl script which creates a directory in the local machine.
    > But, if I call this script from the remote machine using rsh, the
    > directory is not created. And there is no error message reported. Why
    > is that so ?
    >
    > What is the remedy for this ?


    Does the script make any assumptions about which dirctory it starts in?
    Write debugging messages to /tmp

    gtoomey
    Gregory Toomey, Oct 21, 2003
    #2
    1. Advertising

  3. qazmlp

    Tintin Guest

    "qazmlp" <> wrote in message
    news:...
    > I have a perl script which creates a directory in the local machine.
    > But, if I call this script from the remote machine using rsh, the
    > directory is not created. And there is no error message reported. Why
    > is that so ?
    >
    > What is the remedy for this ?


    Does your script have something like?

    mkdir '/path/to/dir' or die "Can not mkdir /path/to/dir $!\n";

    If not, why not?
    Tintin, Oct 21, 2003
    #3
  4. qazmlp

    qazmlp Guest

    "Tintin" <> wrote in message news:<bn336u$r9k3k$-berlin.de>...
    > "qazmlp" <> wrote in message
    > news:...
    > > I have a perl script which creates a directory in the local machine.
    > > But, if I call this script from the remote machine using rsh, the
    > > directory is not created. And there is no error message reported. Why
    > > is that so ?
    > >
    > > What is the remedy for this ?

    >
    > Does your script have something like?
    >
    > mkdir '/path/to/dir' or die "Can not mkdir /path/to/dir $!\n";
    >
    > If not, why not?


    I have mkdir command in the script.
    When the rsh was executed with 'mkdir' directly, it worked and the
    directory was created. But, when the perl script(containing mkdir) was
    executed, it did not work.
    qazmlp, Oct 21, 2003
    #4
  5. qazmlp

    Roy Johnson Guest

    (qazmlp) wrote in message news:<>...
    > I have a perl script which creates a directory in the local machine.


    It is better to post the relevant chunks of code than merely to
    describe them. In Perl, There Is More Than One Way To Do It, and there
    may be a problem with the Way you have chosen.
    Roy Johnson, Oct 21, 2003
    #5
  6. qazmlp

    Tintin Guest

    "qazmlp" <> wrote in message
    news:...
    > "Tintin" <> wrote in message

    news:<bn336u$r9k3k$-berlin.de>...
    > > "qazmlp" <> wrote in message
    > > news:...
    > > > I have a perl script which creates a directory in the local machine.
    > > > But, if I call this script from the remote machine using rsh, the
    > > > directory is not created. And there is no error message reported. Why
    > > > is that so ?
    > > >
    > > > What is the remedy for this ?

    > >
    > > Does your script have something like?
    > >
    > > mkdir '/path/to/dir' or die "Can not mkdir /path/to/dir $!\n";
    > >
    > > If not, why not?

    >
    > I have mkdir command in the script.
    > When the rsh was executed with 'mkdir' directly, it worked and the
    > directory was created. But, when the perl script(containing mkdir) was
    > executed, it did not work.


    You still haven't answered by previous question.

    Post a relevant snippet of your code.
    Tintin, Oct 24, 2003
    #6
  7. qazmlp

    qazmlp Guest

    "Tintin" <> wrote in message news:<bnat60$v94hk$-berlin.de>...
    > "qazmlp" <> wrote in message
    > news:...
    > > "Tintin" <> wrote in message

    > news:<bn336u$r9k3k$-berlin.de>...
    > > > "qazmlp" <> wrote in message
    > > > news:...
    > > > > I have a perl script which creates a directory in the local machine.
    > > > > But, if I call this script from the remote machine using rsh, the
    > > > > directory is not created. And there is no error message reported. Why
    > > > > is that so ?
    > > > >
    > > > > What is the remedy for this ?
    > > >
    > > > Does your script have something like?
    > > >
    > > > mkdir '/path/to/dir' or die "Can not mkdir /path/to/dir $!\n";
    > > >
    > > > If not, why not?

    > >
    > > I have mkdir command in the script.
    > > When the rsh was executed with 'mkdir' directly, it worked and the
    > > directory was created. But, when the perl script(containing mkdir) was
    > > executed, it did not work.

    >
    > You still haven't answered by previous question.
    >
    > Post a relevant snippet of your code.


    Here is an excerpt from the script:
    $opath=$ProtName;
    opendir(DIR,$opath) || system("mkdir $ProtName");
    closedir (DIR);

    I don't know whether it helps to find the cause of the problem.

    Meanwhile, the problem was solved by selecting the option,
    "execute all rsh commands as user: ", for rsh in remote machine.
    qazmlp, Oct 27, 2003
    #7
  8. qazmlp

    Tintin Guest

    "qazmlp" <> wrote in message
    news:...
    > >
    > > You still haven't answered by previous question.
    > >
    > > Post a relevant snippet of your code.

    >
    > Here is an excerpt from the script:
    > $opath=$ProtName;
    > opendir(DIR,$opath) || system("mkdir $ProtName");
    > closedir (DIR);
    >
    > I don't know whether it helps to find the cause of the problem.
    >
    > Meanwhile, the problem was solved by selecting the option,
    > "execute all rsh commands as user: ", for rsh in remote machine.


    Originally, I asked:

    > > > > Does your script have something like?
    > > > >
    > > > > mkdir '/path/to/dir' or die "Can not mkdir /path/to/dir $!\n";



    and you answered.

    > > > I have mkdir command in the script.


    Yes, you have a mkdir, but you are forking out to do something that can be
    done natively in Perl (as in my example) and you have no error checking.

    Use the Perl mkdir with error checking, and then see what happens.
    Tintin, Oct 28, 2003
    #8
  9. (qazmlp) writes:

    > Here is an excerpt from the script:
    > $opath=$ProtName;
    > opendir(DIR,$opath) || system("mkdir $ProtName");
    > closedir (DIR);
    >
    > I don't know whether it helps to find the cause of the problem.


    Not really. Perhaps you should replace the system("mkdir $ProtName")
    with mkdir($ProtName) and then, if it fails, print out the reason that
    it reports.

    --
    \\ ( )
    . _\\__[oo
    .__/ \\ /\@
    . l___\\
    # ll l\\
    ###LL LL\\
    Brian McCauley, Oct 28, 2003
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David H
    Replies:
    0
    Views:
    478
    David H
    Dec 3, 2004
  2. Replies:
    1
    Views:
    325
    Puppet_Sock
    Jun 15, 2007
  3. zenshade

    Newbie problem with perl and rsh

    zenshade, Aug 8, 2004, in forum: Perl Misc
    Replies:
    8
    Views:
    134
    zenshade
    Aug 10, 2004
  4. Replies:
    2
    Views:
    106
    J├╝rgen Exner
    May 10, 2005
  5. Rafael The Angel

    perl rsh problem

    Rafael The Angel, Nov 18, 2008, in forum: Perl Misc
    Replies:
    1
    Views:
    106
    Tad J McClellan
    Nov 18, 2008
Loading...

Share This Page