| 1 |
|
| 2 |
num-utils is Copyright 2002-2003 Suso Banderas |
| 3 |
====================---------------------------- |
| 4 |
|
| 5 |
**PLEASE ALSO READ THE WARNING FILE THAT** |
| 6 |
**COMES WITH THIS PROGRAM.** |
| 7 |
|
| 8 |
Description - num-utils are a set of utilities that aim to provide |
| 9 |
the numeric equivilent of the GNU text-utils. These programs do |
| 10 |
operations on numbers such as filtering, adding, averaging and so on. |
| 11 |
They help expand and complete the shell vocabulary. |
| 12 |
|
| 13 |
Right now these programs are in the beta stage. If you have any bug |
| 14 |
fixes or suggestions to improve this program, please see the "Contact" |
| 15 |
section of this document . An extensive list of planned features is |
| 16 |
in the 'GOALS' file included with this program. |
| 17 |
|
| 18 |
Installation |
| 19 |
------------ |
| 20 |
|
| 21 |
For now please use the Makefile to install the programs. By default |
| 22 |
this will install them in /usr/bin. Standard 'make' and 'make install' |
| 23 |
commands will build and install the programs. You can also make an RPM |
| 24 |
source and binary package from the Makefile using 'make rpm'. |
| 25 |
|
| 26 |
How to use |
| 27 |
---------- |
| 28 |
|
| 29 |
These programs are useful when you want to deal with numbers on stdin or |
| 30 |
from files. There are different programs for different functions: |
| 31 |
|
| 32 |
numsum - Adding a set of numbers from stdin is simply a matter of passing |
| 33 |
just the numbers themselves to numsum. |
| 34 |
|
| 35 |
$ cat test/numbers | numsum |
| 36 |
21937.74 |
| 37 |
$ |
| 38 |
|
| 39 |
You can use other programs like numgrep, awk or sed to get just the numbers |
| 40 |
that you want from a file: |
| 41 |
|
| 42 |
$ cat access_log | awk {'print $10'} | numsum |
| 43 |
|
| 44 |
numgrep - Simular to grep, but specific to numbers. This program will let |
| 45 |
you search for ranges of numbers and sequences. |
| 46 |
|
| 47 |
$ numgrep /-5..5,100..200/ tests/numbers |
| 48 |
5 |
| 49 |
135 |
| 50 |
135 |
| 51 |
1 |
| 52 |
1.5 |
| 53 |
4.5351 |
| 54 |
3 |
| 55 |
3 |
| 56 |
-1 |
| 57 |
-2.543 |
| 58 |
-1 |
| 59 |
3 |
| 60 |
|
| 61 |
random - Generates random numbers based on range expressions. |
| 62 |
|
| 63 |
$ randnum /0..100/ |
| 64 |
47 |
| 65 |
$ |
| 66 |
|
| 67 |
range - This program will spit out a sequence of numbers for use in stuff |
| 68 |
like shell for loops. The syntax for this program will most likely |
| 69 |
change in the next version. |
| 70 |
|
| 71 |
$ range /5..10/ |
| 72 |
5 6 7 8 9 10 |
| 73 |
$ |
| 74 |
|
| 75 |
$ for i in `range /1..5,10..15/` ; do mv track$i.mp3 song$i.mp3 ; done |
| 76 |
1 |
| 77 |
2 |
| 78 |
3 |
| 79 |
4 |
| 80 |
5 |
| 81 |
10 |
| 82 |
11 |
| 83 |
12 |
| 84 |
13 |
| 85 |
14 |
| 86 |
15 |
| 87 |
$ |
| 88 |
|
| 89 |
interval - This program will calculate and display the interval between |
| 90 |
every two seqeuntial numbers on the input stream: |
| 91 |
|
| 92 |
$ cat numbers |
| 93 |
1 |
| 94 |
2 |
| 95 |
3 |
| 96 |
5 |
| 97 |
10 |
| 98 |
45 |
| 99 |
35 |
| 100 |
2 |
| 101 |
1 |
| 102 |
$ cat numbers | interval |
| 103 |
1 |
| 104 |
1 |
| 105 |
2 |
| 106 |
5 |
| 107 |
35 |
| 108 |
-10 |
| 109 |
-33 |
| 110 |
-1 |
| 111 |
$ |
| 112 |
|
| 113 |
Contact |
| 114 |
------- |
| 115 |
|
| 116 |
Please send bug reports, suggestions, requests or correspondence to Suso Banderas |
| 117 |
at '[email protected]'. You can visit the homepage for this program at: |
| 118 |
|
| 119 |
http://suso.suso.org/programs/num-utils/ |
| 120 |
|
| 121 |
|