【问题标题】:Running a Linux command from R on Windows Server 2012在 Windows Server 2012 上从 R 运行 Linux 命令
【发布时间】:2018-04-22 04:44:55
【问题描述】:


我在 Windows Server 2012 上安装了 R,我正在尝试在 Linux 服务器上执行命令 - 类似于

bash echo \"samplecommand?filename=testfile.zip\" | nc -vv -w 2 testserver portnumber

据我了解,WSL 存在于 Windows 10 中,这使得执行 linux bash 脚本变得容易。
是否有可能在 Windows Server 2012 R2 的 R 中执行此操作,或任何其他方式来实现此目的?
谢谢

【问题讨论】:

    标签: r linux bash windows-server-2012-r2


    【解决方案1】:

    我认为我的问题可能措辞不正确。我想要执行的实际应用程序是 netcat (nc),所以我需要做的就是为 windows 安装 netcat,然后执行

    input = "cd C:\\folderwherenetcatisinstalled
    echo samplecommand?filename=testfilename| nc -w2 servername portnumber"
    system("cmd.exe", input = input)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-25
      • 2013-04-12
      • 1970-01-01
      • 2014-04-16
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      • 1970-01-01
      相关资源
      最近更新 更多