elmar@xxxxxxxxxxxxxxxxxx wrote:
Hi Gingat!...
Gingat Florent wrote:
[snip]
Sorry, maybe "quoted-printable" was the wrong choice for the attachment. I'll paste the script at the bottom of this mail.
Calculations in the shell are a bit tricky. The least common denominator seems to be the 'dc' command (desktop calculator?) which features some reverse polish
notations (like in forth or postscript ...).
Unfortunately dc expects a file which contains the appropriate commands. Now, the special file name '-' means standard input. So the following commands get piped into dc via the echo command
(in human readable form)
STOPTIME=`echo "scale=4 ; $TMPFILESIZE / 176400" | bc`
In the script this should be
count= $( echo $2 * 2048 | bc )
imho clearer and easier than "count=`echo $2 "2048 * p q" | dc -` "
Returning to the script, i would write:
count= $(( $2 * 2048 ))
Bye, -- Giulio Canevari