Plink error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akyuceisik
    New Member
    • Sep 2008
    • 6

    Plink error

    My script is simple:

    Code:
     #!/usr/bin/perl
    
     `plink alcatel@50.1.1.10 -pw alcatel ls /usr`;

    The error message is:
    Unable to open connection:
    Name or service not known
    Last edited by numberwhun; Sep 26 '08, 11:58 AM. Reason: Please use code tags
  • Icecrack
    Recognized Expert New Member
    • Sep 2008
    • 174

    #2
    First off please use code tags,

    Second thats not related to perl, unless it works in Shell for *nix.

    also why is ls should'nt you be piping /usr in there??

    eg.

    Code:
     Plinx XXXXXXXXXXX xxxxx@xxx || ls /usr

    Comment

    • akyuceisik
      New Member
      • Sep 2008
      • 6

      #3
      But when iexecute this command in prompt line, it works.

      In perl script , if i put this command between `'s, it must execute this command.

      Comment

      • Icecrack
        Recognized Expert New Member
        • Sep 2008
        • 174

        #4
        ok,


        try

        Code:
        system(`plink alcatel@50.1.1.10 -pw alcatel ls /usr`);

        Comment

        • akyuceisik
          New Member
          • Sep 2008
          • 6

          #5
          It's OK now, but not with `'s with 's :-)

          One more question,

          system('mail ahmet@gmail.com -s "trial" "trial"');

          when i write this the script hangs on.

          Comment

          • Icecrack
            Recognized Expert New Member
            • Sep 2008
            • 174

            #6
            almost for got to get more detail, it may hang but thats because we didnt end it if it had errors.



            try

            Code:
            system('mail ahmet@gmail.com -s "trial" "trial"') || die "Error: $!";


            and please put all your code in code tags

            Comment

            • akyuceisik
              New Member
              • Sep 2008
              • 6

              #7
              sorry, ill do it nex time,

              thanks for your help.

              Comment

              Working...