Some Shell Scripts

Format Latex Table Content

format-latex-table.sh is used for formating the content of tables in latex. This script takes as input a text file and prints the formated content in standard output.

If the content of a text file "content.txt" looks like:

After formatting, it looks like:

If you are using vim to write your paper, you can add the following line to your .vimrc:
   map <leader>ft :w! /tmp/ft.out<CR>:!format-latex-table.sh /tmp/ft.out > /tmp/ft.in<CR> gvxk :r /tmp/ft.in<CR> :!rm /tmp/ft*<CR><CR>

Send svn notification email

I wished I could receive notification email when my team member commits his/her updates. I asked google and the solution I got is to setup svn hook "post-commit". Unfortunately, I couldn't find such hook in my local repository and also I don't have the access to the svn server, which is administrated by our labstaff. Therefore, I wrote a Python script which checks the HEAD of the repository and sends email notification if there are any updates in the repository.

svn-notify.py (Rename it to svn-notify.py)
config.cfg

Download the Python script and the configuration file. Suppose you put them in /home/user/svn-notification. First edit config.cfg according to your own setting and then add the following line in your crontab:

*/1 * * * * python /home/user/svn-notification/svn-notify.py

You should be able to receive svn notification email within a minute.