UnixOnWindows

From Odwiki

Jump to: navigation, search

Here's how I setup a unix environment on Windows.

  1. Download cygwin from http://www.cygwin.com. I can't remember what packages I downloaded but the default ones should be good. Install it to c:/cygwin
  2. Create the c:/bin directory. Copy the csh.exe from your latest Houdini distribution and put it into c:/bin. I also recommend that you add this directory to your system wide PATH environment variable. Note that this csh.exe is the same as the regular win32 version of tcsh. Pre-built binary for the latest version can be found at http://www.blarg.net/amol/
  3. Now set up a HOME environment variable to point to your home directory (eg. c:/home).
  4. Inside the directory that you designated HOME, create a file named .login . Add the following line to the beginning of the file.
        setenv PATH '.;'$HOME'/bin;c:/bin;c:/cygwin/bin;'$PATH
    On my home system, I use the Windows version of vim and gvim (download from http://www.vim.org) which I install to c:/vim. I modify my .login to also include this like o.
        setenv PATH '.;'$HOME'/bin;c:/vim/vim61;c:/bin;c:/cygwin/bin;'$PATH
        setenv EDITOR vim.exe
        setenv VISUAL gvim.exe
    To set this up for Houdini, you have to also source the Houdini environment. I also added this line to the end of the .login file.
        cd "C:/Program Files/Side Effects Software/Houdini 6.1.208"
        source houdini_setup
  5. Copy a shortcut from c:/bin/csh.exe to your desktop (and/or quicklaunch bar). Right-click on the new shortcut and choose Properties... In the Target name add the -l option after csh.exe. This tells csh.exe to source your .login file when it starts.
  6. To launch, click on the shortcut. This should open up a new window that is set up with the unix environment.


After this, you can further modify your .login file. A good starting point is to launch this csh and then do

cd $HOME
printrc >> .login

I generally comment out the lines "set correct=all" and "set autocorrect" as I find those features annoying. I also dislike having my aliases stored in my .login file. I extracted out those lines at the end, put it into a separate .alias file, and then add the following line to .login instead.

source $HOME/.alias

Here's what I currently have in my $HOME/.alias file at home:

alias ls 'ls-F'
alias l 'ls-F'
alias ll 'ls-F -l'
alias h 'history'
alias rm 'rm -i'
alias rd 'rmdir'
alias md 'mkdir'
alias mv 'mv -i'
alias cp 'cp -i'
alias pwd 'echo $cwd'
alias env 'printenv'
alias unsave 'unset savehist savedirs'
alias ali 'gvim /.alias; source /.alias'
© 2009 od[force].net | advertise