Writing a program to an input stream

I am using oracle wallet to store oracle database passwords, batch file to create wallet asks for password when it starts. is there a way to change the batch file and provide a password before getting started

so that I can avoid entering the password every time I run it.

To summarize the problem, is there a way that I can write to the input stream of another program.

so that I can avoid prompts from automation scripts.

0


source to share


2 answers


You can use the pipe operator "|" to redirect the standard output of one program to the input stream of another. I work on both unix and windows platforms.

In your example, you would have a script simply

echo mypassword

      



and you would run this from the command line:

myscript | wallet

      

I assume your script will be named myscript.bat and wallet.exe wallet program, change them accordingly.

+2


source


Enter the password in a text file like password.txt

and you can work like



myprogram.exe <password.txt

if the program accepts two inputs, enter the second input on the second line of the text file.

0


source







All Articles