简体   繁体   中英

Passing system commands along with command line arguments in Eclipse

Is there some way to pass system commands along with command line arguments in Eclipse?
Eg passing to the command line arg result in the code to process the file and rest passed to the terminal for creation. 传递到命令行arg会导致代码处理文件,并将rest 传递给终端以进行创建。

I'm not sure about a general answer, but if you want to forward stdout somewhere you can use an option already present in Run Configuration dialog: 替代文字

If you only want to redirect the output, the launch configuration dialogs allow this in their last tab, "common", as noted in Jacks answer.

If you want to use input redirection or pipes, you can only use the external tools launcher. Create an external tool configuration and pass the whole command line as one string to the command interpreter, cmd.exe , and pass /c as the first argument. The special syntax of the location tells Eclipse to search the PATH for the program.

Location: ${system_path:cmd.exe}

Arguments: /c echo Hello world>output.txt

Right click on Eclipse then go to "Run as" Select Run Configurations Then Select Arguments in new Window First window

Second main Window ://i.stack.imgur.com/MqU2f.png

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM