Hobbes, not sure here but I guess you need to change #!/bin/sh for #!/bin/bash in the first script.

Anyone can tell us if it's right?

Rui Pais: nice signature. It's always nice to see that somebody else appreciates the same writers that I do.