Wednesday, October 25, 2006

Vim Vim Vim

This ~/.vimrc suits my needs quite well:

:syntax enable
colorscheme default
:let fortran_have_tabs=1

To check what colors we have: vi /usr/share/vim/current/syntax/colortest.vim, and source %

To set different colorschemes, check in /usr/share/vim/vim64/colors directory for *.vim files.

To make your own colorscheme, copy a sample colorscheme to ~/.vim/colors directory as mine.vim for ex.. Change it to suit ur needs. Then add the following line to ~/.vimrc file:

colors mine

Friday, October 20, 2006

Redirection and pipes

We can redirect stderr to stdout like this:
ls -l doesnotexist >& outputfile
ls -l doesnotexist >>& outputfile (to append)
Redirect stderr and stdout to a pipe:
find . -name "doesnotexist" -print |& grep -v "denied"
Redirect both stderr and stdout to both stdout and a file:
find . -name "doesnotexist" |& tee outputfile

Thursday, October 12, 2006

Grabbing output of system commands with perl

Grabbing output of system commands with perl