Why is it that Cygwin can run .bat scripts?

前端 未结 3 1622
[愿得一人]
[愿得一人] 2020-12-17 10:06

When I execute a .bat script from bash in Cygwin, by what mechanism is it running? I understand that if I run a .EXE it will launch, regardless of whether the .EXE is from

相关标签:
3条回答
  • 2020-12-17 10:36

    And if you want to fork an *.cmd file execution like a ShellScript process and append his log to an file:

    cmd /c test.bat > nohup.out &
    

    Enjoy!

    0 讨论(0)
  • 2020-12-17 10:39

    I believe that bash in cygwin sees the bat extension as being flagged executable (a cygwin hit-tip to windows convention). As such it loads and executes the file with it's associated interpreter (cmd.exe, per os configuration), much as it creates a new instance of bash to run your #! scripts (per posix standard).

    0 讨论(0)
  • 2020-12-17 10:45

    Running

    ./test.bat params
    

    from bash seems to be equivalent to

    cmd /c test.bat params
    
    0 讨论(0)
提交回复
热议问题