perl - how to logon to different host machine and run some tool over there and get the data back to the original host using scripting -
problem statement: consider present scenario, running commands/code on host-1, , need open tool on host-2 may perform operations on data obtained on host-1.
what doing till opening 2 different shells, 1 host 1 , host 2, after running codes on host-1 switch manually other shell prompt, deal commands on tool. , move original shell.
an example executing basic linux command on host-2 , capturing response. ex: ls -l on host-2 while on host-1 , results in variable kept further processing.
is there way automate thing?? mean way in can logon host-2 on fly , execute tool commands , host-1 ?
i prefer writing perl script this.
do mean this?
#!/usr/bin/perl use strict; use warnings; @results = qx(ssh host-2 ls -l); print @results;
or looking more complicated?
Comments
Post a Comment