Skip to content
A POSIX shell for Windows.
C Ada C++ M4 Objective-C Python Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
c Remove use of String_List during filename expansion Feb 1, 2019
contrib Fix locale in 'sed' Feb 15, 2016
cygwin Add Python scripts to install cygwin Feb 26, 2019
gnutools Ensure sed takes into account locales Oct 10, 2016
testsuite Adjust handling of --recompile switch in run-test Feb 1, 2019
.gitignore Switch to new list implementation Feb 1, 2019
.gitreview Update .gitreview after repository rename Nov 30, 2015
Makefile Switch to new list implementation Feb 1, 2019
posix_shell.gpr Switch to new list implementation Feb 1, 2019

GSH - A POSIX shell for Windows

General Information

GSH is an implementation of a POSIX shell developed for the Windows platform.

The aim of the project is to provide an efficient UNIX shell instantiation for Windows, for non interactive usage.

GSH can be used to compile projects depending on autotools, UNIX make,... As it targets specifically Windows platform, GSH differs significantly from the most used ones such as bash, zsh. Among others, its implementation does not depend on the 'fork system call' and doesn't emulate that system call (as it's done on Cygwin). This allows better compiling performance (the build times can be up to 3 or 4 times faster than builds performed by projects such as Cygwin).

XKCD on shell escaping

Image from XKCD

Build & Installation


$ make
$ make install PREFIX=<target directory>

Alternatively to just compile the gsh binary you can do:

$ gprbuild -p -P posix_shell

Example of Usage

Currently the main goal of the project is to speed up builds of GNU projects on Windows platform. As the project is still not complete you still need a Cygwin installation for the tools not provided by GSH. The only requirement is that the build should be done in a path for which Cygwin path maps directly to a Windows path. For example if you do your build in c:/MyBuilds then in Cygwin the path should map to /MyBuilds.

An example of build sequence that does not destroy your current Cygwin environment:

$ (export PATH=$GSH_INSTALL_DIR/bin:$PATH;
   export SHELL=$GSH_INSTALL_DIR/bin/gsh; 
   export CONFIG_SHELL=$GSH_INSTALL_DIR/bin/gsh;
   $CONFIG_SHELL/configure --prefix=/myinstall_dir


All files are provided under terms of the GNU General Public License version 3.

The project includes fragments of other projects with licenses compatible with the GNU General Public License version 3:

You can’t perform that action at this time.