【问题标题】:Running command in background using cygwin from Windows cmd使用 Windows cmd 中的 cygwin 在后台运行命令
【发布时间】:2012-04-14 23:16:03
【问题描述】:

我在我的 Windows 命令行中使用 cygwin,除了能够在后台运行某些东西(即将& 放在命令的末尾)之外,我总是很开心地完成了所有事情。

只是为了给你更多的上下文,我希望能够启动 Mercurial Web 服务器,并且仍然能够继续使用命令行窗口,甚至在不终止服务器的情况下关闭它。例如:

>hg serve &
listening at http://localhost:8000/ (bound to *:8000)
>echo "Still able to do this"

有什么解决方法吗?

【问题讨论】:

    标签: windows command-line cygwin


    【解决方案1】:

    我在运行Apache时遇到了类似的问题,最后我用了cygstart,就像CMD start

    cygstart --hide /c/apache/bin/httpd.exe

    在这种情况下,由于--hide 选项,它将作为后台进程运行 Apache

    【讨论】:

    【解决方案2】:

    找到解决方案:

    start <command> /B
    

    start 是一个 windows 命令,请执行help start 以获取更多信息

    另外,对于我的情况

    hg serve --daemon
    

    hg serve -d
    

    会成功的

    【讨论】:

    • 对我来说,start 不能从 cygwin 访问; cygstart 虽然有效。
    • 从批处理脚本运行时没有预期的效果。终端就在那里
    猜你喜欢
    • 1970-01-01
    • 2012-11-11
    • 1970-01-01
    • 2018-03-14
    • 1970-01-01
    • 2014-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多