Question

I am trying to run a cygwin script in powershell. How can I do that?

I tried giving full path of the scripts followed by args . it isnt working example : /c/script/path/script args

Was it helpful?

Solution

Use either /cygdrive/c/script/path/script or C:/script/path/script (note the capital C and lack of leading slash in the latter path). Plus, need to run the script with the correct interpreter, e.g.:

& C:\cygwin\bin\bash.exe /cygdrive/c/script/path/script ...

OTHER TIPS

Having cygwin installed with the ssh stuff and SCP utility you can simply issue:

C:\cygwin\bin\scp.exe /cygdrive/c/Users/YOU/Documents/file.txt root@remoteserver:/tmp/

I find above can marked solution becomes a bit too shortcoming as the bash profile is not quite the same as in a working cygwin bash environment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top