Re: [Ssh-sftp-perl-users] assigning variables to automate sftp login
Brought to you by:
dbrobins
From: Morgan S. <mo...@du...> - 2007-07-26 17:01:02
|
Ralf Wiegand wrote: > # The file push.ctl contains information needed to perform the ftp for > each host. >=20 > open(VARIABLES, "push.ctl"); >=20 > LINE: while(<VARIABLES>) { >=20 > =20 > ($dir,$ibm,$ftp_home,$hostname,$username,$password,$typ,$site,$file)=3D= split(/:/); >=20 > my $host =3D 'xxx.yyy.zzz.aaa'; > my %args =3D (user =3D> "userid", > password =3D> "password", > ssh_args =3D> [port=3D>22]); >=20 >=20 > I'm reading in the information needed to sftp files to a remote server.= =20 > How can I also assign $username to user =3D> ? You could do this: my %args =3D ( user =3D> $username, password =3D> $password, ssh_args =3D> [port=3D>22], ); > So I can reading in IP address ($hostname), user ($username) and > password ($password) from a input file? > Thank You > Ralf >=20 --=20 Morgan Smith Dutro Company 675 North 600 West Logan, UT 84321 (435) 752-3921 x146 GPG Key: 76E09074 Keyserver: http://www.keyserver.net/ |