Results 1 to 4 of 4
Hi all,
I have written a cp progress bar that gives out the % of completion, but there is a slight hitch...
I am unable to get the numericals at ...
- 06-08-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 20
% encounter at the same place, how to?
Hi all,
I have written a cp progress bar that gives out the % of completion, but there is a slight hitch...
I am unable to get the numericals at the same place, meaning 1% changing over to 2 ,then 2 to 3 so on...
The bar that i have now will actually print something like this
1% ,2% .......100%.
But this is not what i want....i want a change over rather than a lead in...
Could you please help me figure out a way to escape this?
Thanks
- 06-08-2008 #2Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Have you tried using backspace characters (x08 ) before outputting, to backup the cursor and overwrite the extant text?
- 06-08-2008 #3
scm is right on the dot! In fact, there's even a backslash escape to do it for you (\b).
To illustrate, just do this:
echo will print "a", then a backspace (deleting the "a"), and then a "c".Code:echo -e "a\bc"
Easy peasy!DISTRO=Arch
Registered Linux User #388732
- 06-09-2008 #4Just Joined!
- Join Date
- May 2008
- Posts
- 20
ok, Thanks
I will try it out and let you know!!!


Reply With Quote