UNIX script to run on WINDOWS UNIX script to run on WINDOWS unix unix

UNIX script to run on WINDOWS


I know you don't want an "add on", but if this may help : you can download MobaXterm (or a portable version of it), which will come with many things, including many unix utilities (shell, etc) and lots you can download from their website.

The portable version is the most convenient (and you can carry it on your usb key, for example)

It's quite slower than cygwin/etc (most commands are emulated via some master binary, and many shell "builtins" becomes instead invocations of that binary, for example), but very portable and neat.

Other solutions (converting, etc) probably will also entail a binary of some sort, so I recommand the above, as it's very portable and gives you a kind of "mini unix inside windows"


Another answer for this old question is to install and run light Unix-like emulators. Here are some options:

  • MinGW -- native Windows port of the GNU Compiler Collection (GCC)
  • MSYS -- command line terminal called mintty, bash, version control systems like git and subversion, tools like tar and awk and even build systems like autotools
  • GitBash -- BASH emulation used to run Git from the command line. *NIX users should feel right at home

The above list installs micro environments much lighter than a typical Cygwin install. Also, in my experience most Bash scripts run on par with native Linux environments in these environments.

Yet another option is installing a Linux Subsytem like WSL2.

Yet another option is converting Bash to DOS by hand or with partial assistance of something like Bash-to-BAT converter, which isn't very full featured, and the Advanced Bash-Scripting Guide.