【问题标题】:Converting Unix command into Windows command将 Unix 命令转换为 Windows 命令
【发布时间】:2016-11-07 17:14:57
【问题描述】:

我必须在 Windows 上工作,但是我在将 UNIX 命令转换为 Windows 命令时遇到了一些困难。

我有一个执行此命令的 node.js 服务器:

const execSync = require('child_process').execSync;
...
...
let output = execSync('output=$(wget --post-data '
+ '"' + text + '" ' + '"localhost:' + port
+ '/?properties={"annotators": ' + '"' + annotators + '", "outputFormat": "'
+ format + '"' + "}' -qO -) && echo $output', { encoding: 'utf8' });

你有什么想法吗?

【问题讨论】:

标签: node.js windows unix


【解决方案1】:

首先这是bash语法,你需要把东西转换成windows cmd行格式。

  • 默认情况下,wget 在 windows 命令行上不可用。看到这个: Wget for windows

【讨论】:

  • @onedkr 默认情况下,Windows 中没有 wget 之类的本机命令。您可以查看该链接以获取 Windows 版本的 Wget
【解决方案2】:

仍然可以在 Windows 上运行 UNIX 命令。您可以从这个 GitHub 存储库下载为 Windows 编译的所有 UNIX 命令:https://github.com/George-Ogden/UNIX

【讨论】:

    猜你喜欢
    • 2013-07-08
    • 1970-01-01
    • 2011-05-24
    • 2017-10-19
    • 2015-12-27
    • 1970-01-01
    • 2016-12-14
    • 1970-01-01
    • 2021-07-25
    相关资源
    最近更新 更多