Automating cygwin commands in windows command line (and ultimately in MsBuild)

后端 未结 1 1078
鱼传尺愫
鱼传尺愫 2020-12-31 12:27

I have a situation where I have a few cygwin commands which I wish to be run in Windows command line e.g.

chmod 777 /home/administrator/*

C

相关标签:
1条回答
  • 2020-12-31 13:21

    One way to do this is to launch windows command prompt from a batch file, then, in there, call the shell script which has the command that you want to run.

    batchfile-for-cygwin.bat will contain

    @echo off
    C:\cygwin\bin\bash -li /cygdrive/c/<path-to-shell-script-location>/chmod-cmd.sh
    

    And then, in chmod-cmd.sh you can just have the command.

    chmod 777 /home/administrator/*
    

    With this kind of setup, you can use it in MSBuild too, I should think. I use it in Ant scripts and it works for me.

    0 讨论(0)
提交回复
热议问题