According to Steve Youngs: While burning my CPU.
> 
> Hey! Did you see what Richard Adams wrote on May 10 ?
> 
> RA> 
> RA> Would not;
> RA> echo -e "+\n"$TIME_ELAPSED >> /etc/ppp/logs/prog-tot
> RA> help. ??
> 
>       Sorry Richard, this doesn't work... it generates the wrong type of
> output to prog-tot.  It gives:
>       0
>       +       
>       n
>       +       
>       n
> And what I need is:
>       0+n+n+n

The command "tr" would convert C/R's.

>  
> RA> Or if i am not seeing the point you could try.
> RA> echo "+" ; $TIME_ELAPSED >> /etc/ppp/logs/prog-tot
> RA> echo -e "+\n" ; $TIME_ELAPSED >> /etc/ppp/logs/prog-tot
> 
>       Neither of these work for two reasons.  First it sort of gives the
> same type of output as your first suggestion.  And second because the
> semi-colon tells bash that $TIME_ELAPSED is another command to execute.
> $TIME_ELAPSED isn't a command its a variable that contains a number.
> 
> RA> There are man more combinations to use as well.
> 
>       I found something that worked!!  I just added the following two
> lines to the start of the script that tests the total time for the
> month...
> cat /etc/ppp/logs/prog-tot > /tmp/test-tot
> echo -e "\n" >> /tmp/test-tot
> 
> Then I use...
> TIMES_UP=$(bc -q /tmp/test-tot < /etc/ppp/logs/q)

I'm glad to hear it now works, now i see what you mean, anyway would not the
"command expr" be a lot easier to implement, 'expr 1234 + 1234' would add
the two togehter.
Of course not having seen the whole script makes that realy also hard to
say.


> 
>       Thanks for your help Richard, it got me thinking about the problem in a
> slightly different way and I was able to solve it by "thinking outside the
> box".
> 
>       BTW, if anyone would like a way for timing how long they spend on
> the internet (via dial-up ppp) let me know and I'll send you my scripts.

I would be interested, please thanks.

> 
> Regards, Steve Youngs <[EMAIL PROTECTED]>   ICQ: 34307457
> ----------------------------------------------------------
> |                                __                      |
> |Isn't it good to know that     / /   __ ___  __ ____  __|
> |There _IS_ an alternative!    / /__ / // _ \/ // /\ \/ /|
> |                             /____//_//_//_/\_,_/ /_/\_\|
> ----------------------------------------------------------
> 
> 


-- 
Regards Richard.
[EMAIL PROTECTED]

Reply via email to