Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

210
Vistas
pass commands server using perl openssh

there are 2 systems,

client system, in which i am passing commands to the server by doing openssh to the server and my script goes like this

#!/usr/bin/perl
use lib "/home/geek/app/usr/lib/perl5/site_perl/5.8.8";
use lib "/home/geek/app/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi";
use lib "/usr/lib/perl5/5.8.8";

use Net::OpenSSH;
my $host = '******010';
my $user = '*****';
my $pass = '*****';
my $ssh = Net::OpenSSH->new("$user:$pass\@$host");
$ssh->error and
 die "Couldn't establish SSH connection: ". $ssh->error;
my $out = $ssh->capture("/p/inway/bin/inway71 lib123 p123.0_CC default ");
#my $out = $ssh->capture("cd units; ls");
#$out = $ssh->capture("ls units/");

 print "output is $out";

and in server /p/inway/bin/inway71 is a scripts:

#!/bin/sh
. $MODULESHOME/init/sh
module load lsf

exec bsub -Is -q interactive -J INWAY71_LSF -R 'type==X64LIN && osrel==50 && clearcase' /nfs/site/proj/inway/bin/inway71 ${1+"$@"}

so when i login to my server and run this script in my terminal, i will be directed to some path (i have no clue what it is, but i guess its one more server which i can login using this bash script) and i can do the rest of the activity like cd,ls,cat, etc etc)

but when i run this from my client system it passes the control to the terminal and waits for my input, and in my terminal i get an error saying,

stty:standard input:Invalid argument

In my terminal i can do ls or anything, but not able to do it from the perl script and capture the result. How can i resolve this and get what i want?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

That remote command expects to be run in interactive mode. This doesn't work with the SSH command mode. See this Net::OpenSSH FAQ!

You can:

  1. find a way to pass commands as arguments to that script.
  2. rewrite it to accept commands as arguments.
  3. talk to it using Expect.
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda