printing trailing dot

I am using centos 5.3

The problem still persists even after using kill $IND_PID >/dev/null 2>&1

The output being:

jre installation started.........../jreinstall.sh: line 15: 13513 Terminated ind
jre installation complete

Another thing that i noticed is that if i run the script for the first time in a new system the output "jreinstall.sh: line 15: 13513 Terminated ind"
is not appearing. From the 2nd time onwards the problem is arising. I have tested the same in three systems and the same occurred everywhere. Really puzzled ......

---------- Post updated at 10:44 PM ---------- Previous update was at 10:42 PM ----------

If i give you access to my system then you people could check it yourself.

---------- Post updated at 11:00 PM ---------- Previous update was at 10:44 PM ----------

See the below output when i run script two consecutive times:

[root@cntos5 ~]# ./jreinstall.sh
jre installation started.........jre installation complete

[root@cntos5 ~]# ./jreinstall.sh
jre installation started............jre installation complete
./jreinstall.sh: line 16: 14583 Terminated ind

First time the problem didn't arise, 2nd time it surfaced.

Answered this in:

http://www.unix.com/shell-programming-scripting/119364-until-loop-fails.html\#post302353830

This uses the concept of a worker script (for you the thing that is doing the install) and a dot maker. The worker can do as much as it want while the dots are being made. The worker/dot pair could be modified so that that the worker could do multiple things and inform the dot maker of its progress. The dot maker could then make more informative displays...

Interesting problem. You are right it is not coming from the kill command but from the background job that was killed. Somehow this is getting through to tour interactive shell. My guess would be that your script terminates before your background process is killed. You could try inserting a wait statement:

kill $IND_PID
wait $IND_PID
printf "\njre installation complete\n"

If that still does not work, perhaps the background process can be silenced by calling it as

ind & 2>/dev/null

I can't reproduce your error so I have to guess...

S.

thanks Scrutinizer, but the solutions provided by you didnt work. But i seem to have found a solution. I will share with you soon.....

---------- Post updated at 10:13 AM ---------- Previous update was at 09:56 AM ----------

I thought that since the output of the kill command was creating all the fuss, why not get rid of it ... N instead of running the dots in background i thought of creating a function for "silent installation of jre" portion and running that function in background. The function will terminate once the silent installation is complete and ther will be no need to kill any background process.

The modified script is:

funct()
{
mv /bin/more /bin/more1
/root/jre-6u16-linux-i586.bin << EOF &> /dev/null && mv /bin/more1 /bin/more;rm -f /root/jre-6u16-linux-i586.bin
yes
EOF
}

printf "jre installation started"
funct &
while ps $! > /dev/null
do
printf "."
sleep 0.5
done
printf "\njre installation complete\n"

Please review the script and suggest your views. Its working for me...
If you find any fault or you can suggest any improvement please feel free to revert. Thanks in advance.