无法识别 Windows 脚本命令

发布于 2024-12-22 04:43:16 字数 671 浏览 2 评论 0原文

我正在尝试运行 cmd 文件,但收到奇怪的错误。我正在运行这个:

#!/bin/ksh
#@echo off
#REM *************************************************************************
...
...

但结果返回时出现错误,如下所示:

C:>#!/bin/ksh
'#!' is not recognized as an internal or external command,
operable program or batch file.

C:>#@echo off
'#@echo' is not recognized as an internal or external command,
operable program or batch file.

C:>#REM *************************************************************************
'#REM' is not recognized as an internal or external command, 
operable program or batch file.

我在两台计算机上尝试过此操作,结果相同。谁能告诉我为什么会发生这种情况?

I am trying to run a cmd file but I am receiving strange errors. I am running this:

#!/bin/ksh
#@echo off
#REM *************************************************************************
...
...

But the results are returned with errors like so:

C:>#!/bin/ksh
'#!' is not recognized as an internal or external command,
operable program or batch file.

C:>#@echo off
'#@echo' is not recognized as an internal or external command,
operable program or batch file.

C:>#REM *************************************************************************
'#REM' is not recognized as an internal or external command, 
operable program or batch file.

I have tried this on two computers with the same results. Can any one tell me why this is happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

¢好甜 2024-12-29 04:43:16

这是一个 ksh 脚本,通过 ksh (或任何 shell,如 bashsh启动它) cshtcsh 可以理解 #! 行)而不是 Windows 命令行。您可能需要安装 cygwin(使用 ksh),启动 cygwin 终端并从那里启动脚本。

This is a ksh script, launch it though ksh (or any shell like bash, sh, csh or tcsh which understand the #! line) and not the windows command line. You may need to install cygwin (with ksh), start a cygwin terminal and launch your script from there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文