solving the shell script problem