[ale] Perplexed by bash

William Miller smeadspam100 at speedfactory.net
Wed May 4 11:00:37 EDT 2005


Well a nasty hack without a ton of restructure is to drop the RC into a small text file then read it in in the while loop (now this kinda depends on the scope of start_process i.e.  if your starting thousands this isn't a great idea)

Nasty Hack Example:
start_process(){
        sleep 2
        echo "This is start process"
        RC=1
        echo "$RC" > rc.txt
}
start_process 2>&1 | \
while read line 
do
            echo "$line RC:`cat rc.txt`  \$?:$? 456"
done


Like I said...nasty hack if you've "got to get it going" (think James T voice here).  I'll think about it more (i'm sure the gurus here will think of something WAY better)

K

-- 
"It is not the critic who counts, not the man who points out how the strong man stumbles or where the doer of deeds could have done them better.  The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood, who strives valiantly, who errs and comes up short again and again because there is no effort without error and shortcomings, who knows the great devotion, who spends himself in a worthy cause, who at the best knows in the end the high achievement of triumph and who at worst, if he fails while daring greatly, knows his place shall never be with those timid and cold souls who know neither victory nor defeat."

-Theodore Roosevelt



More information about the Ale mailing list