Hello. I'm writing an awk script that looks at a .csv file and calculates the weighted grade based on the scores and categories in the file. I keep getting a fatal division by zero attempted error and I know what it means but I've been looking over the code for awhile and am not sure what is causing it. Here is the code that I have:
Thought i should start this has a new thread.
i am stuck on the following question, but after learning more unix, i have written an answer to it. Can anyone check to see if it is correct and what improvements need to be made?
Question:
Write a pipeline that updates the content of a file (a... (0 Replies)
Hello,
I am searching for a way to calculate for example 10/100 within a shellscript and the result should be 0.1 and not just 0.
Every alternative i tried just results 0
Thank you in advance
2retti (6 Replies)
hi,
The below commands result only the whole number(not giving the decimal values).
pandeeswaran@ubuntu:~$ echo 1,2,3,4|sed 's/,/\//g'|bc
0
pandeeswaran@ubuntu:~$ echo 1000,2,3|sed 's/,/\//g'|bc
166
How to make it to return the decimal values?
Thanks (5 Replies)
when i try the snippet in the console its working fine:
ps awwwux | grep php-fpm | grep -v grep | grep -v master | awk '{total_mem = $6 * 1024 + total_mem; total_proc++} END{printf("%d\n", total_mem / total_proc)}'
output:
but when i try the bash script:
#!/bin/sh
# -*- sh -*-
#... (3 Replies)
I want to implement the below formula with awk oneliner
new_value = ((old_value - old_min) / (old_max - old_min) ) * (new_max - new_min) + new_min
I want to pass the value of old_min and old_min as variable. Here is what I did for this
old_min=$(awk 'BEGIN{a=100000000000}{if ($10<0+a) a=$10}... (2 Replies)
Today, I noticed some errors in our SSL cert renewal log files, mostly related to domains where the IP address had changed. Concerned about this, rebuilt out SSL cert, which normally goes well without a hiccup.
However, for today, for some reason which I cannot explain, there was a PHP error... (0 Replies)
Discussion started by: Neo
0 Replies
LEARN ABOUT DEBIAN
mtbl_info
MTBL_INFO(1)MTBL_INFO(1)NAME
mtbl_info - display information about an MTBL file
SYNOPSIS
mtbl_info FILE [FILE]...
DESCRIPTION mtbl_info(1) displays the following information about the MTBL files specified on the command line.
file name -- the name of the MTBL file.
file size -- the total size of the MTBL file, in bytes.
index bytes -- the total number of bytes and proportion of the total file size consumed by the index.
data block bytes -- the total number of bytes and proportion of the total file size consumed by data blocks.
data block size -- the maximum size of an uncompressed data block.
data block count -- the total number of data blocks.
entry count -- the total number of key-value entries.
key bytes -- the total number of bytes that all keys in the file would occupy if stored end-to-end in a byte array with no delimiters.
value bytes -- the total number of bytes that all values in the file would occupy if stored end-to-end in a byte array with no delimiters.
compression algorithm -- the algorithm used to compress data blocks. Possible values are "none", "snappy" and "zlib".
compactness -- a rough metric comparing the total number of bytes in the key-value entries with the total size of the MTBL file. It is
calculated as (file size) / (key bytes + value bytes), and thus takes into account the gains of data block compression and prefix key
compression against the overhead of the index, trailer, and data block offset arrays.
05/29/2012 MTBL_INFO(1)