bash script illustrating the problem