I'm trying to reconstruct how to execute a bash shell .sh file on my Windows machine from within Notepad++ using NPPExec. (I've done this successfully before, but my HDD crashed and I don't recall how I did it previously.)
When it was working before, I would run the NPPExec script that called a .sh file, and it showed me the console output of the .sh file processing in Notepad++ as if it were processing in cygwin.
This is the example .sh file that I'm trying to get to work:
message="Testing"
echo $message
This file is located in the root of C:.
Failed Attempts:
None of the following three methods work:
C:\nppexec.shResponse:
CreateProcess() failed with error code 193:
%1 is not a valid Win32 application.
npp_exec C:\nppexec.shResponse:
message="Testing"
CreateProcess() failed with error code 2:
The system cannot find the file specified.
$message
Adding #! /bin/bash to the .sh file as the first line just causes an additional error when npp_exec is run:
NPP_EXEC: C:\nppexec.sh
#! /bin/bash
CreateProcess() failed with error code 2:
The system cannot find the file specified.
The solution was to call bash directly:
C:\cygwin\bin\bash --login -c "command.sh"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With