0

I have to work on Windows, However I have some difficulties to convert a UNIX command into a Windows command.

I have a node.js server which execute this command :

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' });

Do you have an idea ?

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
onedkr
  • 3,226
  • 3
  • 21
  • 31
  • Why don't you [do it with node](http://stackoverflow.com/q/6158933/7552) instead of calling out to an external command? – glenn jackman Nov 07 '16 at 17:23

2 Answers2

0

First of all this is the bash syntax, you need to convert the things into windows cmd line format.

  • wget is not available by default on windows commmand line. See this: Wget for windows
Kumar Shubham
  • 484
  • 6
  • 17
  • @onedkr by default there is no native command like wget in Windows. You can check that link for a windows version of Wget – Kumar Shubham Nov 15 '16 at 14:21
0

It is still possible to run UNIX commands on Windows. You can download all of the UNIX commands compiled for Windows from this GitHub repository: https://github.com/George-Ogden/UNIX

George Ogden
  • 596
  • 9
  • 15