Any half-way serious user of UNIX command line tools quickly gets disgusted with the what Windows makes available. Thankfully some other people were sufficiently annoyed to help out here. This document discusses to major paths you can take to get closer to genuine POSIX style commands under Microsoft Windows.
| Project Name | Mode | Description | Advantages | Disadvantages |
|---|---|---|---|---|
| Cygwin | Custom | Forces nearly a full POSIX environment upon Windows. |
|
|
| http://www.cygwin.com/ | ||||
| UnixUtils | Native | Popular GNU commands compiled to run in native Windows mode. |
|
|
| http://sourceforge.net/projects/unxutils | ||||
| vim | Native GUI | Vim Visual editor (consider as companion to UnixUtils) |
|
|
| http://www.vim.org/ | PuTTY | Native GUI | ssh and scp command family by Simon Tatham |
|
| http://www.chiark.greenend.org.uk/~sgtatham/ | ||||
This author prefers to install third party programs under the tree "C:\Program Third" rather than "C:\Program Files". This allows better separation of Microsoft software from the rest of the world.
The primary exception to this rule is when the third-party installers are too stupid to install properly anywhere but "C:\Program Files".
You must change the instructions herein to match your own installation conventions.
Not discussed here yet as I haven.t used Cygwin in years
Install vim within your standard directory tree. Notice where the binary itself is left (gvim.exe) as it must be added to PATH under UnixUtils.
Note that the name is gvim rather than vi or vim.
Install within your standard directory tree. Notice where the binaries go as they must be added to PATH under UnixUtils.
Note that the names start with "p" (e.g., putty for ssh operations, pscp for scp).
PuTTY comes with a collection of utilites to manipulate certificates.
These provide the bulk of the popular GNU command line utilities. A shell derived from FreeBSD "sh" shell is also installed. Installation is simple: simply unzip the file into the proper directory. This author would use "C:\Program Third\UnixUtils". Your system may vary.
The binaries from this install are spread over several directories. Due to some file names conflicting with native Windows commands, unconditionally putting these directories in the PATH variable is a bad idea as either Windows or UnixUtils will sometimes find the wrong programs.
This author solves the conflicts by always starting the "sh" shell from a shortcut that does the right configuration, including setting PATH, for the shell being run. All programs running in that window inherit the UnixUtils configurations. As this file is edited early on it is given a ".txt" extension to allow it to easily be edited from Notebook or Wordpad.
A typical "sh.txt" file follows, stored in the UnixUtils directory:
Some special notes:
# sh.txt - shell script to initialize UnixUtils sh.exe export PATH="C:/Program Third/Vim/vim71;C:/Program Third/UnixUtils/usr/local/wbin;C:/Program Third/UnixUtils/bin;C:/Program Third/PuTTY;$PATH"; export SHELL="$0"; export PS1="$( basename "$HOME" )\$ "; cd "$HOME" if [ -f _profile ]; then . _profile; fi cd "$HOME/My Documents" pwd exec c:/Program Third/UnixUtils/bin/sh.exe
The Windows shortcut is set up as follows:


/
writings | |||
|
http://www.exit109.com/~ghealton/writings/POSIX_under_Windows.html |
||
| Hits since 2008-02-06: |
$Id: POSIX_under_Windows.hmac,v 1.1 2008/02/06 12:13:31 ghealton Exp $ Last formatted 2008-02-06 (Disclaimer) |
||