From: Masatake Y. <je...@gy...> - 2004-05-16 18:02:04
|
I've changed the reading progress notation to percentage style. If we can show a progress bar, it may be the best. But, I don't know how to erase written string on a terminal in a shell script. Masatake YAMATO Index: debugger/dbg-io.inc =================================================================== RCS file: /cvsroot/bashdb/bashdb/debugger/dbg-io.inc,v retrieving revision 1.8 diff -u -r1.8 dbg-io.inc --- debugger/dbg-io.inc 12 Nov 2003 11:48:51 -0000 1.8 +++ debugger/dbg-io.inc 16 May 2004 17:27:53 -0000 @@ -109,6 +109,7 @@ i=1 else local fullname=$(_Dbg_resolve_expand_filename $filename) + local line_count=`cat $fullname|wc -l` filevar=`_Dbg_file2var $filename` if [[ -r $fullname ]] ; then for (( i=1; 1 ; i++ )) ; do @@ -116,8 +117,8 @@ local readline_cmd="read -r $source_entry; rc=\$?"; local -i rc=1 if (( i % 1000 == 0 )) ; then - (( i==1000 )) && _Dbg_msg_nocr "Reading $filename " - _Dbg_msg_nocr "${i}... " + (( i==1000 )) && _Dbg_msg_nocr "Reading $filename: \n" + _Dbg_msg_nocr "\t$(( 100 * ${i} / ${line_count} ))%..." fi eval $readline_cmd if [[ $rc != 0 ]] ; then |