Error: "-gThe system cannot find the file specified." When bash script containing "cut" is run from cmd

Matt D.
Sat Oct 31 12:36:58 GMT 2020

Simple Bash script:

> #!/bin/bash
> cut

Save as "" in C:\ or elsewhere.

Open a Windows command prompt and type:

> cmd /c bash -c /c/

I get the following error:

> -gThe system cannot find the file specified.

This only seems to trigger when bash is running as a child process of cmd.

More information about the Cygwin mailing list