in reply to Calling an executable and entering login credentials
In a very simple situation, you may be able to get by with IPC::Open3, which opens the program, and gives you pipes to write to, and read from, the executable.
A simple example:
#!/usr/bin/perl use warnings; use strict; use IPC::Open3; $|=1; # you would run Sametime here, instead of bash my $pid=open3(\*IN,\*OUT, \*ERR , '/bin/bash'); # set \*ERR to 0 to send STDERR to STDOUT # # in your case, print the login name here my $cmd = 'date'; #send cmd to bash print IN "$cmd\n"; my $result = <OUT>; print $result;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling an executable and entering login credentials
by Thomas Kennll (Acolyte) on Sep 02, 2012 at 17:34 UTC | |
by Mr. Muskrat (Canon) on Sep 02, 2012 at 19:49 UTC | |
by afoken (Chancellor) on Sep 02, 2012 at 17:57 UTC | |
by Thomas Kennll (Acolyte) on Sep 02, 2012 at 18:38 UTC | |
by aitap (Curate) on Sep 02, 2012 at 20:14 UTC |