in reply to Re: Re: Re: Re: Cron, Shell Script, and Perl
in thread Cron, Shell Script, and Perl

I doubt it. You'll be printing out to the STDOUT of your script, which has little to do with the STDIN of the pgp process, even assuming that it will let you. And I'm guessing that pgp will not even ask the question, as it has no controlling TTY to begin with. I guess there has to be a way to fake one, but I don't know how.

-- Dan

  • Comment on Re: Re: Re: Re: Re: Cron, Shell Script, and Perl

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Cron, Shell Script, and Perl
by landonc (Novice) on Oct 07, 2002 at 16:54 UTC
    The following code worked and is now implemented via a cron job. The problem came about when it was actually waiting for expect to find the text. Instead of waiting for it to find it I knew that it would only take a second or two for it to ask for the password so I just set the timer to 10 seconds and it works. File decrypted successfuly.
    # Start the pgp decrypt process. ($decrypt = Expect->spawn("pgp $pgpfile")) || die "Couldn't spawn pgp +decrypt, $!"; # Wait for 10 seconds then post the password. sleep(10); print $decrypt "pass phrase goes here\r"; if(-e $outfile){ $message="$pgpfile decrypted successfully to $outfile."; } else{ $message="$pgpfile NOT decrypted to $outfile!"; } sleep(5); system("mv $pgpfile archive/");
    Thanx for the help.