Re: ssh to a remote machine

2005-06-22 Thread D. J. Birkett
Vijay Kumar Adhikari wrote: Hi, I need to ssh to a remote machine, run a command and get the output. Is there some modules that can help. TIA Vijay You could start here... http://search.cpan.org/search?query=ssh&mode=all -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: using open3 to interact with external program--ANSWER FOUND

2005-06-13 Thread D. J. Birkett
OK thanks to Zentara, my code now looks like... #!/usr/bin/perl use warnings; use strict; use IPC::Open3; local $SIG{CHLD} = 'IGNORE'; local $SIG{PIPE} = 'IGNORE'; my $childpid = open3(\*IN, \*OUT, \*ERR, 'gpg --no-greeting --no-tty --command-fd 0 --status-fd 1 --edit root'); print IN "tru

Re: using open3 to interact with external program

2005-06-08 Thread D. J. Birkett
Zentara wrote: Since you are not showing us your code, we can only guess. My guess is that you are not setting up the gpg command properly. Here is what I now have... use IPC::Open3; local(*HIS_IN, *HIS_OUT, *HIS_ERR); $childpid = open3(*HIS_IN, *HIS_OUT, *HIS_ERR, 'gpg --edit root'); sle

Re: using open3 to interact with external program

2005-06-08 Thread D. J. Birkett
Thomas Bätzler wrote: D. J. Birkett <[EMAIL PROTECTED]> asked: OK I've tried altering my code as you suggested, replacing the regexes with ones that would work. gpg still just sits there as soon as it has entered it's intereactive mode, and perl doesn't seem to be passi

Re: using open3 to interact with external program

2005-06-07 Thread D. J. Birkett
Zentara wrote: Something along these lines print HIS_IN "trust\n"; chomp(my $answer = ); if( $answer =~ /^How many years?$/ ) { print HIS_IN "5\n"; }else{print "years error $!\n"; exit} chomp(my $answer1 = ); if( $answer1 =~ /^Are you sure?$/ ) { print HIS_IN "yes\n"; }else{prin

using open3 to interact with external program

2005-06-03 Thread D. J. Birkett
Hi, I'm trying to use open3 to control input to an external program (in this case gpg). I would use Expect, but I need to use packages that are installed as standard with perl as this script will be running on many platforms. I simply want to enter interactive mode of gpg, pass it 3 command

Re: passing input to an external programs shell

2005-05-19 Thread D. J. Birkett
D. J. Birkett wrote: Chris Devers wrote: On Wed, 18 May 2005, D. J. Birkett wrote: I'm trying to call gpg externally Why? Can't you just use something like Crypt::GPG? <http://search.cpan.org/~agul/Crypt-GPG-1.52/GPG.pm> This script is to be run from an nfs mount on many sy

Re: passing input to an external programs shell

2005-05-18 Thread D. J. Birkett
Chris Devers wrote: On Wed, 18 May 2005, D. J. Birkett wrote: I'm trying to call gpg externally Why? Can't you just use something like Crypt::GPG? <http://search.cpan.org/~agul/Crypt-GPG-1.52/GPG.pm> This script is to be run from an nfs mount on many systems, so it has

passing input to an external programs shell

2005-05-18 Thread D. J. Birkett
Hi, I'm trying to call gpg externally as part of a small script to import a key and then trust it. It seems that to trust a key, once I've imported it, I must enter the gpg interactive shell. Is there a way to pass commands to this external shell, and then return to my script once it's been d

capture a carriage return from

2005-04-20 Thread D. J. Birkett
I have a script that pauses while the reader reads the intro text, and askes them to press return to continue. At the moment I capture the input from STDIN into a variable called $waste, do nothing with it, and continue anyway. The script complains when it runs... Name "main::waste" used only

glean distro version from /etc/*release

2005-04-08 Thread D. J. Birkett
I'm writing a script that will be run from a mount point on many different linux distros. I'm just about to code a sub that will try and determine the distro (version isn't that important) from the /etc/*release file, and just wondered if anyone has already done this, or if there is some handy