为什么是它可以Cygwin的脚本蝙蝠运行? [英] Why is it that Cygwin can run .bat scripts?

查看:121
本文介绍了为什么是它可以Cygwin的脚本蝙蝠运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行从庆典在Cygwin中一个蝙蝠脚本,由它是运行的机制?我明白,如果我运行一个.EXE,将推出,无论.EXE是从Cygwin的或更传统的环境。我明白,当我执行可执行脚本以#!在那个Cygwin的提供为它运行的魔力开始。

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 Cygwin or from a more traditional environment. I understand that when I execute an executable script with #! at the beginning that Cygwin supplies the magic for it to run.

但是,为什么一个蝙蝠脚本的工作?是否有Cygwin的内部某个组件是知道什么一个Windows的.bat脚本,并与它做什么?或者是它,它是Windows下莫名其妙地无法执行呼叫发起.EXE文件,将不会自动也为蝙蝠脚本的工作呢?

But why does a .bat script work? Is there some component inside of Cygwin that is aware of what a Windows .bat script is and what to do with it? Or is it that it is somehow impossible under Windows to execute a call to launch a .EXE file that won't automatically also work for a .bat script instead?

推荐答案

我相信这cygwin的bash中看到蝙蝠扩展名被标记可执行文件(一个cygwin命中尖Windows约定)。因此,它加载并执行与它相关联的文件间preTER(CMD.EXE,每个操作系统配置),更因为它创造的bash的一个新实例来运行你的#! (每POSIX标准)的脚本。

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).

这篇关于为什么是它可以Cygwin的脚本蝙蝠运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆