# arithmetic(6) [netbsd man page]

```ARITHMETIC(6)							 BSD Games Manual						     ARITHMETIC(6)

NAME
arithmetic -- quiz on simple arithmetic

SYNOPSIS
arithmetic [-o +-x/] [-r range]

DESCRIPTION
arithmetic asks you to solve problems in simple arithmetic.  Each question must be answered correctly before going on to the next.  After
every 20 problems, it prints the score so far and the time taken.	You can quit at any time by typing the interrupt or end-of-file character.

The options are as follows:

-o      By default, arithmetic asks questions on addition of numbers from 0 to 10, and corresponding subtraction.	By supplying one or more
of the characters +-x/, you can ask for problems in addition, subtraction, multiplication, and division, respectively.  If you give
one of these characters more than once, that kind of problem will be asked correspondingly more often.

-r      If a range is supplied, arithmetic selects the numbers in its problems in the following way.  For addition and multiplication, the
numbers to be added or multiplied are between 0 and range, inclusive.  For subtraction and division, both the required result and the
number to divide by or subtract will be between 0 and range.  (Of course, arithmetic will not ask you to divide by 0.)  The default
range is 10.

When you get a problem wrong, arithmetic will remember the numbers involved, and will tend to select those numbers more often than others, in
problems of the same sort.  Eventually it will forgive and forget.

arithmetic cannot be persuaded to tell you the right answer.  You must work it out for yourself.

DIAGNOSTICS
``What?'' if you get a question wrong.  ``Right!'' if you get it right.  ``Please type a number.'' if arithmetic doesn't understand what you
typed.

bc(1), dc(1)

BSD								   May 31, 1993 							       BSD```

## Check Out this Related Man Page

```ARITHMETIC(6)							   Games Manual 						     ARITHMETIC(6)

NAME
arithmetic - provide drill in number facts

SYNOPSIS
/usr/games/arithmetic [ +-x/ ] [ range ]

DESCRIPTION
Arithmetic types out simple arithmetic problems, and waits for an answer to be typed in.  If the answer is correct, it types back "Right!",
and a new problem.  If the answer is wrong, it replies "What?", and waits for another answer.  Every twenty problems, it publishes  statis-
tics on correctness and the time required to answer.

To quit the program, type an interrupt (delete).

The  first optional argument determines the kind of problem to be generated; +-x/ respectively cause addition, subtraction, multiplication,
and division problems to be generated.  One or more characters can be given; if more than one is given, the  different  types  of  problems
will be mixed in random order; default is +-

Range  is a decimal number; all addends, subtrahends, differences, multiplicands, divisors, and quotients will be less than or equal to the
value of range.	Default range is 10.

At the start, all numbers less than or equal to range are equally likely to appear.  If the respondent makes a mistake, the numbers in  the
problem which was missed become more likely to reappear.

As a matter of educational philosophy, the program will not give correct answers, since the learner should, in principle, be able to calcu-
late them.  Thus the program is intended to provide drill for someone just past the first learning stage, not  to  teach  number  facts	de
novo.  For almost all users, the relevant statistic should be time per problem, not percent correct.

ARITHMETIC(6)```
Man Page

## loop through file of numbers

Hope I can explain this correctly.. Have 1 file - filea containing something like the following 00012Bobsmyth 00065JohnDoe 00024MaryOwen I have a range defined in separate functions and basically are set as follows: customer typea 00001-00020 customer typeb 00021-00040 customer...

## Making Changes without opening file

Hello, I'm new to scripting, I have a file test.dat. I want to make changes to it with out openning it. Example: test.dat has rows, and I want to change value "LA" to "TX" without opening it or without writing it to another file. Is it possible? Thanks

## rhost problems

dear unix gurus, trying to search for this thread in the forum but can't seem to find any of them. just would like to post 2 questions: 1) if there are spaces in the .rhosts file will it cause problems for users who try to run the program/ script? :confused: 2) does the .rhosts file be...

## Replacing characters in file with line break

Hi, Apologies if this has been asked before, but I searched and was not able to find an answer. It's probably a simple question to answer for those of you with some experience, though... I have a relatively long string where tokens are separated by the colon (':') character. Let's say the...

## Simple arithmetic in shell

Hey, I just wanted to know how one can write simple arithmetic like addition, subtraction, multiplication and division in shell-script.

## Format problem of text file

Folks pardon me for trivial question. After searching the entire forum i decided to post this question. I have a file with some numbers with commas like this 123,456,789 If i open this textfile with either notepad or wordpad they ae looking absolutely fine. When I open this with excel file...

## A very simple script, but alias won't work

I am new to unix and therefore I did a lot of reading before posting. So please, if this has been answered before, forgive me for re-posting and point me to the right place for the answer. I have spent many hours searching the net and read over 50 posts in this forum and even tried a few thing but...

## addition of both positive and negative numbers

Let, I have three numbers +00123.25 -00256.54 +00489.23 I need to sum up all those three numbers, after storing them in three variables (say var1, var2, var3). I used both expr and BC, but they didn't work for me. But, I am not able to sum up them, as I don't have any idea how to...

## sha1 question

What is the unix shell scripting equivalent of the following php code? I have tried to reproduce it, but I haven't been able to. <?php sha1(sha1(strtolower(\$user) . \$pass) . \$sessionid); ?>

## C++ little question

Hi, I am doing a C++ self-study and I got stuck with this problem. I want to have a code that asks the suer to enter two numbers and then it lists the numbers between these two numbers. It has also to print a message if these two numbers are equal. Here is what I wrote: #include <iostream>...

## little problem of file redirection (awk)

I almost reach my objective (Youhouuu !!!!) But I really don't understand why it doesn't work until the end... :wall: For clarity's sake I am taking a very simple example. The operations I am doing in the script (gsub and print) really don't have any importance !!! I just matter about...

## VIOS FC Mapping/NPIV questions

Please forgive me here as I don't fully understand what I am talking about here so if I use the wrong terminology please overlook me. We have multiple AIX LPARs on the managed system with two VIO Servers. A Co-Worker and I are trying to set up a new LPAR client (The guy that knows this is out)...

## PowerVM/lpar creation problems

Hi, I'm a newbie to PowerVM and LPARs ( I work with VmWare and Oracle VM Server for Sparc) .recently we purchased an 8202-e4b server, with two enclosures for add'l disk capacity. it is licensed for PowerVM standard,came preloaded as such, AIX 7.1. I've set up HMC v8.2, and run it through a VM on...

## A \$(( expression )) bug?

This is for the big guns... I have been modifying AudioScope.sh to bring it inline with more current practices. I hit a bug which IS not present in the original code but was after modification. Shell check first:- #!/bin/sh txt="1234567890" echo "\$(( \$txt ))" echo "\$(( \${#txt} - 1 ))" echo...