0

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?

tynewstar
  • 102
  • 1
  • 11
  • Hope I understood your question correctly: http://stackoverflow.com/questions/15234448/run-shell-commands-using-c-sharp-and-get-the-info-into-string – Jannik Oct 28 '14 at 06:49
  • @Jannik Thanks, let's say i have a command line:"./foo.sh -c black." how to run this? – tynewstar Oct 28 '14 at 07:10

1 Answers1

0

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#

Community
  • 1
  • 1
Jannik
  • 2,310
  • 6
  • 32
  • 61
  • 1
    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? – tynewstar Oct 28 '14 at 10:51
  • 1
    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 :) – Jannik Oct 28 '14 at 13:54
  • Thanks Jannik, i made it as your comments. – tynewstar Dec 02 '14 at 05:44