I have some shell scripts (bash) work correctly on mac. But i want to run them on windows in C#. I think cygwin can make this. but i don't know how to write the code. is there anybody can help me?
-
Hope I understood your question correctly: stackoverflow.com/questions/15234448/…Jannik– Jannik2014-10-28 06:49:45 +00:00Commented Oct 28, 2014 at 6:49
-
@Jannik Thanks, let's say i have a command line:"./foo.sh -c black." how to run this?tynewstar– tynewstar2014-10-28 07:10:18 +00:00Commented Oct 28, 2014 at 7:10
Add a comment
|
1 Answer
You can use the Process class to use CYGWIN under C#.
There are other questions dealing with CYGWIN. Look at this question: bash pipes - I am trying to call script from c#
3 Comments
tynewstar
i can run it in c# now. but some of the commands can't been found. such as type/dirname/grep. how to set the command's path to make the scripts run correctly?
Jannik
The question I linked you in the answer above deals with that question. It seems like you have to have to set the path inside your script :)
tynewstar
Thanks Jannik, i made it as your comments.