467,926 Members | 1,768 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,926 developers. It's quick & easy.

Plink error

My script is simple:

Expand|Select|Wrap|Line Numbers
  2.  #!/usr/bin/perl
  4.  `plink alcatel@ -pw alcatel ls /usr`;

The error message is:
Unable to open connection:
Name or service not known
Sep 26 '08 #1
  • viewed: 3297
6 Replies
Expert 100+
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??


Expand|Select|Wrap|Line Numbers
  1.  Plinx XXXXXXXXXXX xxxxx@xxx || ls /usr
Sep 26 '08 #2
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.
Sep 26 '08 #3
Expert 100+


Expand|Select|Wrap|Line Numbers
  1. system(`plink alcatel@ -pw alcatel ls /usr`);
Sep 26 '08 #4
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.
Sep 26 '08 #5
Expert 100+
almost for got to get more detail, it may hang but thats because we didnt end it if it had errors.


Expand|Select|Wrap|Line Numbers
  1. system('mail ahmet@gmail.com -s "trial" "trial"') || die "Error: $!";

and please put all your code in code tags
Sep 26 '08 #6
sorry, ill do it nex time,

thanks for your help.
Sep 26 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by p | last post: by
1 post views Thread by paafio | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.