开发者

Cygwin: How to pass parameter for a windows program?

I have a small problem with cygwin and passing parameters to a windows program.

My knowledge about windows shells and so on is pretty small. A friend of mine wrote a program for windows to do some calculations. To start the program you just need a console and you have to type something like program.exe param1 param2 param3 everything runs without any problems.

What I need now is to run for different parameters (a lot of different parameters). To do it so, I thought about scripting something and to call 1000times the program by the script. That's why I'm using cygwin because I don't have any windows scripting experience, but some experiences with Linux and bash. My problem is right now I don't know how to pass the parameters for the call.

I tried to pass an array to the command, but this didn't worked out. What I t开发者_如何转开发ried:

args=("param1" "param2" "param3")
./program.exe $args

EDIT

It seems to work if I do the following (as an example):

args="param1 param2 param3"
eval "./program.exe $args"


Try

args="param1 param2 param3"
./program.exe $args

For unix-style arguments this works:

args="-l -t"
ls $args

For Windows style arguments double the slashes:

taskkill //PID 15804
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜