By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,374 Members | 2,014 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,374 IT Pros & Developers. It's quick & easy.

Plink error

P: 6
My script is simple:

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

The error message is:
Unable to open connection:
Name or service not known
Sep 26 '08 #1
Share this Question
Share on Google+
6 Replies


Icecrack
Expert 100+
P: 174
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.

Expand|Select|Wrap|Line Numbers
  1.  Plinx XXXXXXXXXXX xxxxx@xxx || ls /usr
Sep 26 '08 #2

P: 6
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

Icecrack
Expert 100+
P: 174
ok,


try

Expand|Select|Wrap|Line Numbers
  1. system(`plink alcatel@50.1.1.10 -pw alcatel ls /usr`);
Sep 26 '08 #4

P: 6
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

Icecrack
Expert 100+
P: 174
almost for got to get more detail, it may hang but thats because we didnt end it if it had errors.



try

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

P: 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.