Unix FAQ

(Includes Cygwin, Linux, Solaris, and SGI)


Cross-Platform Issues

Windows/Cygwin telnet sucks. Is there anything better?

Absolutely. I can't stand them myself. All kinds of buggy issues with changing window size, vi sessions getting scrambled formatting, etc.

I use Putty, from http://www.chiark.greenend.org.uk/~sgtatham/putty/. It's free, it does SSH as well as telnet (if you're into that), it lets you resize windows easily, lets you configure meta-keys for those apps that use them...it's pretty darn good.

About the only terminal apps that I might prefer to Putty are CRT and SecureCRT from VanDyke ($35 and $99, respectively). Still, Putty is plenty good enough for government work, as it were :-)

I understand that 'bash' is becoming a default on many platforms from Linux to Cygwin, and I have decided that I need to use it more to learn about it. How do I set it up so I can start working productively?

Here is my Cygwin .bash_profile, as a start (Linux users can check ~mzieg/.bash_profile on cvs-oa for an almost-identical Linux example)...
    # .bash_profile

    # set colors and prompt
    export PS1="\[\e]2;peter:\w\007\e[1;36m\]peter [\[\e[1;35m\]\w\[\e[1;36m\]] \u $ \[\e[1;33m\]"


    # configure history editing
    set -o vi
    export HISTSIZE=1000
    export HISTFILE=~/.history
    export HISTFILESIZE=1000
    export EDITOR=vi

    # set aliases for colors
    alias vi=vim
    alias dir='ls -lav --color=auto'

    # winshit
    export CYGWIN="ntsec"

    # display
    # export DISPLAY=localhost:0

    # place nice
    umask 022

    # cvs
    export CVSROOT=":ext:mzieg@cvs-oa.orl.lmco.com:/usr/local/cvsroot"
    export MAKEFLAGS="--no-print-directory"

    # construct path
    unset PATH
    for i in                \
        ~/bin               \
        /bin                \
        /usr/bin            \
        /usr/local/bin      \
        /sbin               \
        /usr/sbin           \
        /usr/X11R6/bin      \
        /cygdrive/c/WINNT/MS/SMS/CORE/BIN           \
        /cygdrive/c/WINNT/system32                  \
        /cygdrive/c/WINNT                           \
        /cygdrive/c/WINNT/System32/Wbem             \
        /cygdrive/c/Program\ Files/Support\ Tools   \
        /cygdrive/c/NTRESKIT                        \
        /cygdrive/c/stuff                           \
        /cygdrive/c                                 \
        /cygdrive/c/S11/DLL                         \
        /cygdrive/c/MMCSW/BISNET
    do
        if [ -d "$i" ] ; then
            if [ -z "$PATH" ] ; then
                PATH=$i
            else
                PATH="$PATH:$i"
            fi
        else
            echo "Warning: can't append $i to PATH because it doesn't exist."
        fi
    done
    export PATH

    # PRISM variables
    export DATA_HOME=~/PRISM/BaseData
    export MAKE_HOME=~/PRISM/BasePrograms
    export PATH="$PATH:$MAKE_HOME/config/bin:$MAKE_HOME/config/cygwin/bin"
    
And just to complete the magic, here's the corresponding ~/.vimrc to make text editing every bit as enjoyable as command-line navigation :-)
    set autoindent
    set softtabstop=4
    set tabstop=4
    set shiftwidth=4
    set showmatch
    set ignorecase
    set background=dark
    set hlsearch
    set incsearch
    set number
    syntax on
    # only set this last one if you understand the implication
    # re: Makefiles
    set expandtab
    

How do I [...] in vi?

  1. vim (Vi IMproved) is available under Linux, Cygwin, SGI, and Solaris, so why not use that instead?
  2. there are some great vim docs here:

Other Sources of Information