Skip to content

Instantly share code, notes, and snippets.

@remram44
Last active August 6, 2017 08:48
Show Gist options
  • Save remram44/4642964 to your computer and use it in GitHub Desktop.
Save remram44/4642964 to your computer and use it in GitHub Desktop.
Cygwin wrapper for Windows
Cygwin wrapper for Windows
These files are used to expose the "sh" binary to your regular Windows console.
Installation:
* Put sh.bat somewhere in your PATH (example: C:\Windows)
* Put sh_wrapper.sh where sh.bat will find it
(default: C:\cygwin\bin\sh_wrapper.sh)
If you don't use these paths, you will have to adapt the filenames in those
scripts.
@C:\cygwin\bin\sh.exe C:\cygwin\bin\sh_wrapper.sh %*
#!/bin/sh
PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:$PATH
export PATH
MANPATH=/usr/local/man:/usr/share/man:/usr/man:$MANPATH
export MANPATH
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:$INFOPATH
export INFOPATH
# Set the user id
USER="`id -un`"
export USER
sh "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment