简体   繁体   中英

Run terminal and command through xCode

I basically want to write a code that will open terminal on my Mac and run a program. I copied the Terminal application where the executable for the code is. Then I tried:

int system(const char *command);

system("open -a Terminal.app --args gnuplot");

This will open terminal but not nothing more (does not initialize GNUplot).

Thank you!

OP here. I found out the best way to go about this is instead make a .sh file. Within that, I run my code that outputs a data file, and then, within that same .sh file, I run GNUplot how I'd like. It works much better and it automated from terminal instead of trying to make a C code to run terminal.

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