0

My shell script iterates on a text file to process another file. This takes around 2 minutes to finish. By the time this script finishes its task I want to print some random data on console to entertain user. How can I do this.

My code is:

while read line
do
        origVal=`echo $line | awk '{ printf $1 }'`
        newVal=`echo $line | awk '{ printf $2 }'`
        sed "s/$origVal/$newVal/g" File > tmpFile
        mv tmpFile File
done < ConfigFile.txt
Mat
  • 202,337
  • 40
  • 393
  • 406
Piyush Baijal
  • 281
  • 4
  • 13
  • You can run your process in background using `&`. – Giuseppe Pes Aug 08 '13 at 07:31
  • I assume you meant you want a progress bar for the user to look at while the program runs. Check this previous question out: http://stackoverflow.com/questions/238073/how-to-add-a-progress-bar-to-a-shell-script Add echo -ne with \r to overwrite the previous stdout and you should be good to go. – numberten Aug 08 '13 at 07:40

1 Answers1

1

You can always use the command "fortune" at the end of your script. Like so:

fortune

It will print random data to entertain the user.

davvs
  • 1,029
  • 1
  • 11
  • 18