Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 10th, 2005, 9:48 AM   #1
draco2002
Newbie
 
Join Date: Mar 2005
Posts: 2
Rep Power: 0 draco2002 is on a distinguished road
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
draco2002 is offline   Reply With Quote
Old Mar 10th, 2005, 10:37 AM   #2
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
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
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Mar 10th, 2005, 10:56 AM   #3
draco2002
Newbie
 
Join Date: Mar 2005
Posts: 2
Rep Power: 0 draco2002 is on a distinguished road
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
draco2002 is offline   Reply With Quote
Old Mar 10th, 2005, 2:27 PM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:54 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC