简体   繁体   中英

Running a Linux command from R on Windows Server 2012


I have an R installation on Windows Server 2012, and I am trying to execute a command on a Linux Server - something like

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

As far as I understand, WSL exists from Windows 10 which makes it easy to execute linux bash scripts.
Is it possible to do this in R from Windows Server 2012 R2, or any other way to achieve this?
Thanks

I think my question might have been worded incorrectly. The actual app I wanted to execute was netcat (nc), so all I needed to do was install netcat for windows and then execute

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM