Search Results

Search: Posts Made By: wurzul
39,025
Posted By wurzul
Thanks
Thank you all, managed to get to work using:

TARPERC=`echo |awk '{print a / 100 * 5}' a=$SUM`
39,025
Posted By wurzul
Thanks, that works. Additional question: How...
Thanks, that works. Additional question: How would I substitute a variable for the value of 16 ?

TARPERC=`awk '{print ${SUM} / 100 * 5}'`

Doesn't seem to work. Awk moans about the $SUM variable
39,025
Posted By wurzul
ksh script using expr to calculate percentages
Within a ksh script on HP-UX I trying to calculate a percentage of a number (number/100 x percentage) using the below method and expr.

TARPERC=`expr 16 / 100 \* 5`
TARSUM=`expr 16 + $TARPERC`...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 04:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy