Override "system" command

Anonymous
2010-11-06
2013-06-06
  • Anonymous - 2010-11-06

    Hello,
    I'm using mingw64 inside cygwin.
    I noticed that, in contrast to the cygwin-native gcc, the call to

    system(...)
    

    opens the windows cmd.exe instead of sh.exe. So I have to call e.g.

    system("sh.exe -c 'make --help'")
    

    However, this makes it difficult if the command to be executed by sh.exe itself includes single quotation marks.
    Is there any way to change this behavior and directly call sh.exe?

    Alex

     
  • Anonymous - 2010-11-06

    Thank you for your answer.
    As the call to system is inside a library, I don't want to replace every single call to

    system
    

    However, changing the COMSPEC variable make the program call

    sh.exe /c ...
    

    , while 

    sh.exe -c ...
    

    is needed.

    Alex

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks