Is there a way to run Bash scripts on Windows? [closed]

Install Cygwin, which includes Bash among many other GNU and Unix utilities (without whom its unlikely that bash will be very useful anyway).

Another option is MinGW’s MSYS which includes bash and a smaller set of the more important utilities such as awk (you may also want to check the competing fork – Mingw-w64). Personally I would have preferred Cygwin because it includes such heavy lifting tools as Perl and Python which I find I cannot live without, while MSYS skimps on these and assumes you are going to install them yourself.

Updated:
If anyone is interested in this answer and is running MS-Windows 10, please note that MS-Windows 10 has a “Windows Subsystem For Linux” feature which – once enabled – allows you to install a user-mode image of Ubuntu and then run Bash on that. This provides 100% compatibility with Ubuntu for debugging and running Bash scripts, but this setup is completely standalone from Windows and you cannot use Bash scripts to interact with Windows features (such as processes and APIs) except for limited access to files through the DrvFS feature.

Leave a Comment