Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
numaverage.1.gz
numbound.1.gz
numgrep.1.gz
numinterval.1.gz
numnormalize.1.gz
numprocess.1.gz
numrandom.1.gz
numrange.1.gz
numround.1.gz
numsum.1.gz
8 changes: 8 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"generalSettings": {
"shouldScanRepo": true
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure"
}
}
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ VERSION = $(shell cat VERSION)
PROJECT = num-utils
DIST = $(PROJECT)-$(VERSION)
FILES = $(shell cat MANIFEST)
UTILS = average bound interval normalize numgrep numprocess numsum random range round
UTILS = numaverage numbound numinterval numnormalize numgrep numprocess numsum \
numrandom numrange numround
DOCS = CHANGELOG COPYING LICENSE MANIFEST template README GOALS WARNING
TESTS = file fractionalnums numbers numbers2 README zeros
# rpm --showrc is gettin to be hard to parse anymore.
#RPMDIR = /usr/src/redhat
RPMDIR = $(shell rpm --showrc | grep " _topdir" | \
perl -n -e \
'/_topdir(?:\s+|\s+:\s+)(\/.*|%{_usrsrc}.*$$)/; \
$$dir = $$1; $$dir =~ s|%{_usrsrc}|/usr/src|; print "$$1\n";')
'/_topdir(?:\s+|\s+:\s+)(\/.*|%\{_usrsrc\}.*$$)/; \
$$dir = $$1; $$dir =~ s|%\{_usrsrc\}|/usr/src|; print "$$1\n";')

# Modify these as necessary
PERL = /usr/bin/perl
BINDIR = /usr/bin
TOPDIR = $(ROOT)/usr
TOPDIR = $(ROOT)/usr/local
MANDIR = $(TOPDIR)/share/man/man1
DOCDIR = $(TOPDIR)/share/doc/$(DIST)
BINDIR = $(TOPDIR)/bin
Expand All @@ -51,7 +51,7 @@ all: manpages
cat $$file | sed 's|^#!/usr/bin/perl|#!$(PERL)|' > $$file.out ; \
mv $$file.out $$file ; chmod a+x $$file ; done

install:
install: all
install -m 0755 -o 0 -g 0 -d $(BINDIR)
for util in $(UTILS) ; do \
install -m 0755 -o 0 -g 0 $$util $(BINDIR) ; done
Expand Down
30 changes: 15 additions & 15 deletions num-utils.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,32 @@ and aim to help complete the unix shell vocabulary.
make

%install
make ROOT="$RPM_BUILD_ROOT" rpminstall
make ROOT="$RPM_BUILD_ROOT" TOPDIR="$RPM_BUILD_ROOT/usr" rpminstall

%files
%attr(0755 root root) /usr/bin/average
%attr(0755 root root) /usr/bin/bound
%attr(0755 root root) /usr/bin/interval
%attr(0755 root root) /usr/bin/normalize
%attr(0755 root root) /usr/bin/numaverage
%attr(0755 root root) /usr/bin/numbound
%attr(0755 root root) /usr/bin/numinterval
%attr(0755 root root) /usr/bin/numnormalize
%attr(0755 root root) /usr/bin/numgrep
%attr(0755 root root) /usr/bin/numprocess
%attr(0755 root root) /usr/bin/numsum
%attr(0755 root root) /usr/bin/random
%attr(0755 root root) /usr/bin/range
%attr(0755 root root) /usr/bin/round
%attr(0755 root root) /usr/bin/numrandom
%attr(0755 root root) /usr/bin/numrange
%attr(0755 root root) /usr/bin/numround
%doc %attr(- root root) CHANGELOG COPYING GOALS LICENSE README WARNING template
#%attr(0755 root root) tests
%doc %attr(- root root) tests/
%{_mandir}/man1/average.1.gz
%{_mandir}/man1/bound.1.gz
%{_mandir}/man1/interval.1.gz
%{_mandir}/man1/normalize.1.gz
%{_mandir}/man1/numaverage.1.gza
%{_mandir}/man1/numbound.1.gz
%{_mandir}/man1/numinterval.1.gz
%{_mandir}/man1/numnormalize.1.gz
%{_mandir}/man1/numgrep.1.gz
%{_mandir}/man1/numprocess.1.gz
%{_mandir}/man1/numsum.1.gz
%{_mandir}/man1/random.1.gz
%{_mandir}/man1/range.1.gz
%{_mandir}/man1/round.1.gz
%{_mandir}/man1/numrandom.1.gz
%{_mandir}/man1/numrange.1.gz
%{_mandir}/man1/numround.1.gz


%changelog
Expand Down
28 changes: 14 additions & 14 deletions numaverage
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w

# average: Find the average of a set of numbers.
# numaverage: Find the average of a set of numbers.
#
# Copyright (C) 2002-2004 Suso Banderas

Expand Down Expand Up @@ -100,12 +100,12 @@ print "$average\n";
sub help {
print <<"EOF";
---------------------------------------------------------
average : A program for finding the average of numbers.
numaverage : A program for finding the average of numbers.
---------------------------------------------------------
Usage:
average [options] file
| average [options]
average [options]
numaverage [options] file
| numaverage [options]
numaverage [options]

Options:
-i Only return the integer portion of the final sum.
Expand Down Expand Up @@ -198,20 +198,20 @@ sub find_median {

=head1 NAME

average - Find the average of a set of numbers.
numaverage - Find the average of a set of numbers.

=head1 SYNOPSIS

B<average> [-dhiIlmMV] <FILE>
B<numaverage> [-dhiIlmMV] <FILE>

| B<average> [-dhiIlmMV] (Input on STDIN from pipeline.)
| B<numaverage> [-dhiIlmMV] (Input on STDIN from pipeline.)

B<average> [-dhiIlmMV] (Input on STDIN. Use Ctrl-D to stop.)
B<numaverage> [-dhiIlmMV] (Input on STDIN. Use Ctrl-D to stop.)

=head1 DESCRIPTION

B<average> is a program that is part of the numeric utilities package. By default
B<average> will determine the average from all numbers on input. Other
B<numaverage> is a program that is part of the numeric utilities package. By default
B<numaverage> will determine the average from all numbers on input. Other
options allow you to find the mode and median.

=head1 OPTIONS
Expand All @@ -231,11 +231,11 @@ options allow you to find the mode and median.

=head1 SEE ALSO

bound(1), interval(1), normalize(1), numgrep(1), numprocess(1), numsum(1), random(1), range(1), round(1)
numbound(1), numinterval(1), numnormalize(1), numgrep(1), numprocess(1), numsum(1), numrandom(1), numrange(1), numround(1)

=head1 COPYRIGHT

average is part of the num-utils package, which is copyrighted by
numaverage is part of the num-utils package, which is copyrighted by
Suso Banderas and released under the GPL license. Please read
the COPYING and LICENSE files that came with the num-utils package

Expand All @@ -244,7 +244,7 @@ submissions or help for the project.

=head1 MORE INFO

More info on average can be found at:
More info on numaverage can be found at:

=over 1

Expand Down
28 changes: 14 additions & 14 deletions numbound
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w

# bound: Find boundary numbers in files or STDIN.
# numbound: Find boundary numbers in files or STDIN.
#
# Copyright (C) 2002-2004 Suso Banderas

Expand Down Expand Up @@ -87,13 +87,13 @@ exit(0);
sub help {
print <<"EOF";
-------------------------------------------------------------------------------
bound : Find boundary numbers in files or STDIN. By default, find the maximum.
numbound : Find boundary numbers in files or STDIN. By default, find the maximum.
-------------------------------------------------------------------------------
Usage:

bound [options] <file>
| bound [options]
bound [options]
numbound [options] <file>
| numbound [options]
numbound [options]

Options:
-l -- Return the lower bound number in the set (the minimum number)
Expand Down Expand Up @@ -148,19 +148,19 @@ sub find_lower_bound {

=head1 NAME

bound - Find boundary numbers in files or STDIN.
numbound - Find boundary numbers in files or STDIN.

=head1 SYNOPSIS

B<bound> [-dhlV] <FILE>
B<numbound> [-dhlV] <FILE>

| B<bound> [-dhlV] (Input on STDIN from pipeline.)
| B<numbound> [-dhlV] (Input on STDIN from pipeline.)

B<bound> [-dhlV] (Input on STDIN. Use Ctrl-D to stop.)
B<numbound> [-dhlV] (Input on STDIN. Use Ctrl-D to stop.)

=head1 DESCRIPTION

B<bound> is a program that is part of the numeric utilities package. B<bound>
B<numbound> is a program that is part of the numeric utilities package. B<numbound>
will find boundary numbers (minimum and maximum) in files or STDIN. By default
it will find the upper bound in the set of numbers (the maximum number) in the
files or on STDIN. You can use the -l option for finding the lower bound (minimum
Expand All @@ -176,16 +176,16 @@ number).

=head1 BUGS

B<bound> currently will only gather the first number on each line instead of
B<numbound> currently will only gather the first number on each line instead of
all the numbers on the lines.

=head1 SEE ALSO

average(1), interval(1), normalize(1), numgrep(1), numprocess(1), numsum(1), random(1), range(1), round(1)
numaverage(1), numinterval(1), numnormalize(1), numgrep(1), numprocess(1), numsum(1), numrandom(1), numrange(1), numround(1)

=head1 COPYRIGHT

bound is part of the num-utils package, which is copyrighted by
numbound is part of the num-utils package, which is copyrighted by
Suso Banderas and released under the GPL license. Please read
the COPYING and LICENSE files that came with the num-utils package

Expand All @@ -194,7 +194,7 @@ submissions or help for the project.

=head1 MORE INFO

More info on bound can be found at:
More info on numbound can be found at:

=over 1

Expand Down
4 changes: 2 additions & 2 deletions numgrep
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ B<Examples:>
/f1024/ Match any integer that is a factor of 1024.


$ range -N /1..1000/ | numgrep /f1024/
$ numrange -N /1..1000/ | numgrep /f1024/
1
2
4
Expand All @@ -359,7 +359,7 @@ future.

=head1 SEE ALSO

average(1), bound(1), interval(1), normalize(1), numprocess(1), numsum(1), random(1), range(1), round(1)
numaverage(1), numbound(1), numinterval(1), numnormalize(1), numprocess(1), numsum(1), numrandom(1), numrange(1), numround(1)

=head1 COPYRIGHT

Expand Down
18 changes: 9 additions & 9 deletions numinterval
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w

# interval: This program calculates and displays the intervals between the
# numinterval: This program calculates and displays the intervals between the
# first line and the second, between the second line and the third on
# through the end of the file.
#
Expand Down Expand Up @@ -89,7 +89,7 @@ exit(0);
sub help {
print <<"EOF";
-----------------------------------------------------------------------
interval : Calculate the numeric intervals between lines in input.
numinterval : Calculate the numeric intervals between lines in input.
-----------------------------------------------------------------------
Usage:

Expand Down Expand Up @@ -124,19 +124,19 @@ sub process_filehandle {

=head1 NAME

interval - Show the numeric intervals between each line in a file.
numinterval - Show the numeric intervals between each line in a file.

=head1 SYNOPSIS

B<interval> [-dhV] <FILE>
B<numinterval> [-dhV] <FILE>

| B<interval> [-dhV] (Input on STDIN from pipeline.)
| B<numinterval> [-dhV] (Input on STDIN from pipeline.)

B<interval> [-dhV] (Input on STDIN. Use Ctrl-D to stop.)
B<numinterval> [-dhV] (Input on STDIN. Use Ctrl-D to stop.)

=head1 DESCRIPTION

B<inter> is a program that is part of the numeric utilities package. B<interval>
B<inter> is a program that is part of the numeric utilities package. B<numinterval>
will calculate and display the numeric interval between one number and the
next on an input stream.

Expand All @@ -155,11 +155,11 @@ in box office ticket sales for movies on imdb.com. ;-)

=head1 SEE ALSO

average(1), bound(1), normalize(1), numgrep(1), numprocess(1), numsum(1), random(1), range(1), round(1)
numaverage(1), numbound(1), numnormalize(1), numgrep(1), numprocess(1), numsum(1), numrandom(1), numrange(1), numround(1)

=head1 COPYRIGHT

interval is part of the num-utils package, which is copyrighted by
numinterval is part of the num-utils package, which is copyrighted by
Suso Banderas and released under the GPL license. Please read
the COPYING and LICENSE files that came with the num-utils package

Expand Down
Loading