Results 1 to 4 of 4
Hi All,
I am trying to automate the certain procedures in my project that are used to generate certain certificates.
Presently the certificates are generated by manually passing the parameters ...
- 07-11-2011 #1
Need help linux scripting
Hi All,
I am trying to automate the certain procedures in my project that are used to generate certain certificates.
Presently the certificates are generated by manually passing the parameters once the tool is invoked in shell.
Ex:I want to totally automate this and do not want to manually enter the data1.. datan.Code:$ automate Please enter first data: data1 Please enter second data: data2 . . . Please enter nth data: datan
I am new to scripting and not sure how I can pass data1... datan in the script itself...
Can anyone please help me with this?Linux Rocks!!!!
Rinjo
- 07-11-2011 #2Just Joined!
- Join Date
- Jul 2011
- Posts
- 2
how is the data generated itself, statically? You could have it/them in a file that the "automate" script looks at? Or you could pass it/them in as an argument?
- 07-12-2011 #3
The data is not self generated.
It is user inputs that the executable "automate" requires from the user who invoke 'automate'.
Although the inputs are fixed, there are a large number of inputs that need to be provided. Hence passing them as parameters is out of question.
I cannot change the 'automate' binary to look at a file, binary is not generated by me.
My only option is to provide the inputs some how in a secondary script that calls 'automate'.
And that is where I am stuck....
how to provide the inputs from a secondary script when 'automate' is being executed?
Any pointers are highly appreciated...Linux Rocks!!!!
Rinjo
- 07-13-2011 #4Just Joined!
- Join Date
- Jun 2011
- Posts
- 30
If your inputs are fixed: put all your inputs in a file, each input parameter on one line.
example of input file 'automate.in':
Then execute :Code:data1 data2 ... ... datan
I have tried it with a small C program that use the functions printf and scanf, and it works. There may be a problem if the binary 'automate' disables the rederection.Code:$ automate > /dev/null < automate.in


Reply With Quote