This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Input: list of rows with format: "<filesize> filename", e.g. | |
# filesizes.txt | |
####################### | |
# 1000K file1.txt | |
# 200M file2.txt | |
# 2G file3.txt | |
# | |
# Output: | |
cat filesizes.txt | numfmt --from=iec | awk 'BEGIN {sum=0} {sum=sum+$1} END {printf "%.0f\n", sum}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Conky, a system monitor, based on torsmo | |
Any original torsmo code is licensed under the BSD license | |
All code written since the fork of torsmo is licensed under the GPL | |
Please see COPYING for details | |
Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stats.awk | |
# Calculate simple stats for an unsorted input of numerical values using awk. | |
# Prints the Count, Minimum, Maximum, Average, Median, Sum of the input values. | |
# | |
# Usage: | |
# > gen_random.sh | awk -f stats.awk | |
# Count: 100 | |
# Min: 0.202 | |
# Max: 1647.48 | |
# Avg: 280.658 |