![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Posts: 2
Rep Power: 0
![]() |
bash progress bar (freebsd/ portsdb -Uu)
here is the situation
running #portsdb -Uu on freebsd takes a while, and doesn't give you a progress status, but if you type #ps | grep "DIRPR" you get back what folder it is currently on 5650 p1 IL+ 0:01.27 make -B describe DIRPRFX=net/ 22050 p1 IL+ 0:00.07 make -B describe DIRPRFX=science/ so what i want to be able to do is have a script that polls this command and lets you know how far along portsdb is by checking what the DIRPRFX is and where it is in the alphabet. Any help would be greatly appreciated Thanks in advance |
|
|
|
|
|
#2 |
|
Professional Programmer
|
alright, so if you're using every letter of the alphabet, you're gonna have a bar divided in 26 parts. So all you have to do is to run the command, map the letter you're on to a number, A being 1 Z being 26 is the easiest, then print out a star when that number changes. When it's done print a new line, and there's your progress bar.
good luck/ Dizz |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Mar 2005
Posts: 2
Rep Power: 0
![]() |
Thanks for the help
Hey Dizzutch,
Thanks for the help. got that far the only thing holding me back now is my grep regex expression trying to get the first letter after the equals sign 22050 p1 IL+ 0:00.07 make -B describe DIRPRFX=science/ any help with that work be great |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() ![]() |
I put the string you had into a file... then parsed it from there via a script...
You should be able to embed this in your script and rid yourself of the data.dat file... [....]$ cat data.dat
22050 p1 IL+ 0:00.07 make -B describe DIRPRFX=science/
[....]$ cat draco.sh
#!/bin/sh
TARG=`cat data.dat | awk '{print $8}';`
LOCATION=`echo $TARG | cut -c9`
echo $TARG
echo $LOCATION
[....]$ ./draco.sh
DIRPRFX=science/
s
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|