I have a need to create a utility in Suze Linux. The utility will make modifications to some text files, and then use the information in those text files to program a device in the computer using a different executable which accepts command line parameters.
I am fluent in c#, but have never worked with Linux. Should I take the time to learn Gnu C++ to do this, or install Mono? How would I execute the programming utility and pass it command line parameters?
In C and C++ there's system("command arguments")
which you can use to execute a command using the system's interpreter (ie you can use it as though you had typed in the command in the shell). The command string can be constructed at runtime. I'm not very familiar with C#, but if I recall correctly you can use Process
and ProcessStartInfo
classes to run system commands.
Based on the complexity of your program I'd recommend using a scripting language like Perl. It's always a good idea to have a scripting language in your toolbox.
Is there a reason you want to restrict yourself to only C++ or C#? There are many options you could consider, for example:
For very simple tasks:
For slightly more involved tasks you could try a scripting language:
subprocess
to communicate with other processes. Other options:
Obviously there are many other suitable options too.
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.