Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Bash / Shell Scripting (http://www.programmingforums.org/forum26.html)
-   -   Entering Values Through a Batch File? (http://www.programmingforums.org/showthread.php?t=167)

Seb Jul 16th, 2004 7:42 AM

Hey guys, i'm having a little trouble and wondered if you could help.

I'm creating a batch file that when executed will run a keytool to generate an SSL key. Running the keytool isn't a problem, however, once that command has been executed, you are then asked for a password, and further more, details of your name, location, etc. Does anyone know how to make the batch file enter values for each of the required fields? I need these values to be predefined within the batch file.

Hope you can help, thanks,

SEB

Infinite Recursion Jul 16th, 2004 7:55 AM

Does this tool has a command-line interface option? You could pass the values in as parameters to the tool itself.

Otherwise you could set environment variables to values that are predefined, using a "priming" batch script... Then read in those values...

The easiest way would be if the tool has a command-line interface:

mytool -name IR -location US ........ etc.

Seb Jul 16th, 2004 8:28 AM

Ok, I think I've figured it. You are right with the command line interface.

I could have been more specific and said that it is the keytool that comes with j2sdk...

I'll have a play and see what happens - thanks for your suggestion, you've helped me out of this hole!

Seb Jul 16th, 2004 9:27 AM

I've pretty much solved it, however, there's one thing i cannot figure out.

I've amde the script to enter all the values, however, you need to enter a password at the end, OR, press enter if it is the same password as the one given earlier. It is the same, so i need to make the script "press enter" for me. Does this make sense?

Seb

Seb Jul 16th, 2004 9:36 AM

done :)

Infinite Recursion Jul 16th, 2004 1:11 PM

Glad that you got it figured out. :D


All times are GMT -5. The time now is 12:47 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC