I have written a function which will blink a text "Scanning...". Now in the main script when I am doing the scan in the server I want to call this function so that user will see a blinking text on the screen and at the same time script will proceed will the scan function. Once scan is finished - I want to deactivate blink function. Please advise how this can be done....
#/bin/ksh
function blinkScanning()
{
i=0
while i=9999
do
echo "Scanning...\c"
sleep 1
echo "\b\b\b\b\b\b\b\b\b\b\b\b\c"
echo " \c"
sleep 1
echo "\b\b\b\b\b\b\b\b\b\b\b\b\c"
i=$(($i+1))
done
}
#Main script
# capture user inputs
echo "Enter data1"
read DATA1
echo "Enter data2"
read DATA2
# call function blinkScanning something like below
blinkScanning &
#proceed futher while text is blinking
do
scan operations...
scan operations...
scan operations...
done
#stop blink text somehow
echo "Done"
#print results...
Yeah - I tried using tput before but somehow its now working in AIX - I am writing a script for AIX+SUN+LINUX so to make sure it works in all three OSes I have written this blink function using simple echo cmd.
Also when I call the function linke "blinkScanning &" it displays the job no. and pid on screen - how this can be avoided?
---------- Post updated 03-29-12 at 11:06 AM ---------- Previous update was 03-28-12 at 06:34 PM ----------