Hi everyone,
I am new to UNIX and scripting, and I have some problems with the test command.
when i try to execute the command:
test 20070327.gz > 20070320.gz
i try to make a charachter string comparison between the two strings or the two files, to make sure that 20070327.gz is greater than... (2 Replies)
I have been looking into searching various files to display output.
The search criteria will be a month and year to output various numbers in the files.
is there any way to do this with the TEST function or would it have to be another way? (4 Replies)
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
All,
I am getting error when run file check with test operator . Why is it showing the error
if
then
echo 'file found'
fi
ksh: -r: unknown test operator
I know i can use the below code to test the file but why the above is not working
if test -r filename
... (3 Replies)
Hi.
I'm new to this forum, my English perhaps is not so good, but here is my question:
In bash you can use ] for tests, and how I understand it the variable names should be expanded automatically. So this should give "yes":
xx=hello
$ ] && echo yes || echo no
no # not giving "yes"
These two... (2 Replies)
Hi all...
(Apologies for any typos at all.)
This is a step by step _script_ to check if your Arduino is talking to your Linux or Macbook Pro computer using the Terminal...
It works on at least 3 Linux flavours and now the Macbook Pro...
I hope you find it useful as a simple check for... (0 Replies)
i am writing the following snippet and cannot figure out why the variable measType remains 0. it should be 1
I also tried "\#analog" and '\#analog' in the test statement and it still doesn't work. What is going on?
bash$ measType=0
bash$ read line < 2iconfig.ini
bash$ echo $line
#analog... (4 Replies)
I ran into the following and still do not understand entirely the rationale behind this. If someone could explain why things are as they are I'd be thankful.
The following was tested on AIX 7.1 with ksh88, but i suspect that to be ubiquitous. In an installation routine i had to create a set of... (6 Replies)
Discussion started by: bakunin
6 Replies
LEARN ABOUT PHP
gmp_div_qr
GMP_DIV_QR(3) 1 GMP_DIV_QR(3)gmp_div_qr - Divide numbers and get quotient and remainderSYNOPSIS
array gmp_div_qr (GMP $n, GMP $d, [int $round = GMP_ROUND_ZERO])
DESCRIPTION
The function divides $n by $d.
PARAMETERS
o $n
- The number being divided. Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric
string provided that it is possible to convert the latter to a number.
o $d
- The number that $n is being divided by. Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later,
or a numeric string provided that it is possible to convert the latter to a number.
o $round
- See the gmp_div_q(3) function for description of the $round argument.
RETURN VALUES
Returns an array, with the first element being [n/d] (the integer result of the division) and the second being (n - [n/d] * d) (the
remainder of the division).
EXAMPLES
Example #1
Division of GMP numbers
<?php
$a = gmp_init("0x41682179fbf5");
$res = gmp_div_qr($a, "0xDEFE75");
printf("Result is: q - %s, r - %s",
gmp_strval($res[0]), gmp_strval($res[1]));
?>
SEE ALSO gmp_div_q(3), gmp_div_r(3).
PHP Documentation Group GMP_DIV_QR(3)