[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Substitution within system quoted string

Bertram Scharpf

8/27/2007 9:08:00 PM

Hi,

Am Dienstag, 28. Aug 2007, 05:34:59 +0900 schrieb Felix Windt:
> > -----Original Message-----
> > From: Victor Reyes [mailto:victor.reyes@gmail.com]
> > Sent: Monday, August 27, 2007 1:27 PM
> > Subject: Substitution within system quoted string
> >
> > For example, I can hard code the following and it works fine:
> >
> > system("start putty.exe -X -ssh -pw mypassword myuserid@myhostname")
> >
> > But this requires hard coding the password in the script.
> > I would like to do something like the following:
> >
> > system("start putty.exe -X -ssh -pw " ARGV[0] " myuserid@myhostname")
> >
> > Is there a way to substitute within a quoted string?
> > Is there a better way to do this?
>
> system("start putty.exe -X -ssh -pw #{ARGV[0]} myuserid@myhostname")

I don't know what Windows does with this command line. On
Linux you may say a simple

$ ps aux | grep ssh

and the whole command line is shown. Some programs like
GnuPG offer the facility to pipe the password to $stdin;
as far as I know BSD Ssh forbids entirely to pass it from
outside.

Maybe host-based authentication is a better solution for
you.

Bertram


--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-...