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?
            Asked
            
        
        
            Active
            
        
            Viewed 1,503 times
        
    0
            
            
        - 
                    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 Answers
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#
- 
                    1i 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
- 
                    1The 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
- 
                    
 
     
    