开发者

Pre-assign parameter in script

开发者 https://www.devze.com 2023-04-04 02:40 出处:网络
Actually I have trouble naming the title of this post. Because I don\'t know how to summarize my meaning in a professional way. But I\'ll explain my question as below:

Actually I have trouble naming the title of this post. Because I don't know how to summarize my meaning in a professional way. But I'll explain my question as below:

I'm running a program written by C++, co开发者_运维问答mmand is:

./VariationHunter_SC

Then it'll let you type in many parameters:

Please enter the minimum paired-end insert size:

Please enter the maximum paired-end insert size:

Please enter the pre-processing mapping prune probability:

Please enter the name of the input file:

Please enter the minimum support for a cluster:

Obviously I need to type in such parameters one by one to run the program; But I have thousands of such jobs, and need to pre-assign such parameters in script, and submit script to computer. So how can I do that?

thx

Edit so how can I make parameter-list? Just like below?:

140
160
0
mrfast.vh
1

Seems the program cannot recognize these numbers, and distribute numbers..


This depends on how the program actually reads the data that you type in - it's likely that its reading stdin, so you could use separate files with the parameters and pass them in via redirection: ./VariationHunter_SC < parameter-file

It's also possible that the program will accept parameters on the command line, but there's no way of really knowing that (or how) except by whatever documentation the program might come with (or by reading the source code, if it's available and there is no other accurate docs).


Simply use the piping character to pipe the contents of a file to your program example, in a windows command shell: echo "asdf" | pause This will pass "asdf" to the pause program. As a result, pause will print a "Press any key to continue" message, then imediately continue because it will receive the "asdf" string as a response.

So, overall, write or use a program that outputs the contents of your file. Call it, then pipe its output to the program that needs the input.

The unix cat command is such a command that writes the contents of a file to output, or to the input of another executable if you are piping the output.

0

精彩评论

暂无评论...
验证码 换一张
取 消