Hi Monks,
I have a neat little perl wrapper for a tool that we use all the time. It basically checks syntax, and does some verification before this tool lauches. When this tool launches we can run this other little command line csh script which will tell you it's status. Here is the little csh code
#!/bin/csh
set logfile = `/bin/ls -c1tr *.log | tail -1`
set total = `cat jxrun.stg | awk ' {print $4} '`
set stage = `grep STAGE $logfile | tail -1 | awk ' {print $4} '`
echo ""
echo "Total number of Stages .... $total"
echo "Job currently at Stage .... $stage"
echo "scale=2" > .bcinput
echo "$stage/$total*100" >> .bcinput
echo "quit" >> .bcinput
echo ""
echo "Your Dracula Job is" `bc .bcinput` "percent Complete."
echo ""
if ( `bc .bcinput` == 100.00 ) then
echo "The following line should say THE END OF PROGRAM"
echo ""
tail -2 $logfile
echo "If not, your job is still on the last stage."
echo ""
endif
Now obviously I can do this in perl. But I was thinking hey woulnd't this be cool to just append it's progress to your prompt line.. So you always know where it's at?
So does anyone know how to set the prompt (depending on there shell) to monitor somthing like this? Any Ideas?
Thanks so much!!
Rhodium
The <it>seeker</it> of perl wisdom.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|