Search Results

Search: Posts Made By: ddreggors
30,097
Posted By cero
I'd use bc instead of expr for this. With bc you...
I'd use bc instead of expr for this. With bc you can define the number of digits after the decimal point.
$ x=64
$ z=$(echo "scale=10; $x / 23789264 * 100" |bc)
$ echo $z
.0002690200
$ z=`expr...
30,097
Posted By methyl
In integer arithmetic, always do your multiples...
In integer arithmetic, always do your multiples before your divides.
However with these numbers the answer is always going to be zero because the percentage is so small.

If you need to see the...
12,305
Posted By Scrutinizer
Try: sed "s/,\([^']\)/.\1/3" infile
Try:
sed "s/,\([^']\)/.\1/3" infile
15,396
Posted By alister
Unlike character classes, tr ranges are not...
Unlike character classes, tr ranges are not delimited by square brackets. tr '[A-Z]' '[a-z]' is converting [ and ] into themselves, a silent, harmless error.

The unquoted version could trigger...
9
7,002
Posted By Scrutinizer
First we need to record field 1 in the NR==FNR...
First we need to record field 1 in the NR==FNR part, which is done correctly, even though the assigment of $1 is superfluous and it could be written as:
{A[$1]; next}
Then in the second part field...
Showing results 1 to 5 of 5

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