Hi there. I'm new to scripting in bash shell and I have this problem.
I'm trying to make a script that returns the greatest common divisor of two integer numbers according to Euclid's algorithm...
Here is, what I've done:
and I get an error message: line 8:integer exrpession expected
I run the gcd.sh writing in the terminal
where 14 and 28 are integers, right?
So, what's the problem? Could you please tell me what should I write?
Hi,
I am using this script to load up my Oracle Databases, but when I log in through Exceed, it hangs. Can anyone tell me what else I need to add to make this work??
Details
****************************************************************************************************... (11 Replies)
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Hi everybody:
I usually use Mandriva distro (in my laptop), and I have made some scripts. These scripts work correctly but now, in other computer which is installed Ubuntu don't work, and I have this error message:
The script is:
.....
echo "Your option is:"
echo
read option
case... (1 Reply)
Hi All,
Using Expect script when I run it manually it works. But when I put the entry in crontab, the job is still running after 15 hours. The script was created as root. I don't think it's a permission issue. Any idea?
This is what I have under root crontab...
00 18 * * 1-5... (4 Replies)
Hello,,
Im verry new to scripting and have some problems with this script i made..
What it does:
It checks a directory for a new directory and then issues a couple of commands.
checks sfv - not doing right now
checks rar - it checks if theres a rar file and when there is it skips to... (1 Reply)
Hi there,
the following script doesn't work. the first part works, then the second 'grep' fails with ': not found'. However, if I take out the second part (starting with the grep command) and put in a seperate script, it works.
everyone know what's wrong here? no two 'grep' in one script, that... (2 Replies)
I have a script that only works if I remove it from the looping scenario.
#!/bin/bash
# Set the field seperator to a newline
##IFS="
##"
# Loop through the file
##for line in `cat nlist.txt`;do
# put the line into a variable.
##dbuser=$line
echo "copying plugin..."
... (6 Replies)
i have this script and when i ejecute it, the console tell me this " sintax error line 41 unexpected element "}" "
is the sintaxis ok?
#!/bin/bash
if ;then
{
exit 0;
}
if ; then
{
sudo /etc/init.d/apache2 start;
sudo /etc/init.d/mysql start;
php5 &
nautilus... (3 Replies)
hi,
i am trying to run this script.the name of script is final.sh
after i run it:
#./final.sh &
i grep the command
# ps -a | grep bash
and i see more then one processes runing 3!!
Please use code tags
how can i solve this problem?
my target script must always run in... (8 Replies)
I am trying to run a script to make a simple modification to a number of similar files. The sed works, but after it runs and the differences are displayed, the script does not read ans to start a renaming script if the user answered Y or y.for i in "$@"
do
sed -f myfile.sed $i >$i.new
diff... (2 Replies)
Discussion started by: wbport
2 Replies
LEARN ABOUT BSD
mp
MP(3X)MP(3X)NAME
madd, msub, mult, mdiv, pow, gcd, invert, rpow, msqrt, mcmp, move, min, omin, fmin, m_in, mout, omout, fmout, m_out, sdiv, itom - multiple
precision integer arithmetic
SYNOPSIS
#include <mp.h>
#include <stdio.h>
typedef struct mint { int len; short *val; } MINT;
madd(a, b, c)
msub(a, b, c)
mult(a, b, c)
mdiv(a, b, q, r)
pow(a, b, m, c)
gcd(a, b, c)
invert(a, b, c)
rpow(a, n, c)
msqrt(a, b, r)
mcmp(a, b)
move(a, b)
min(a)
omin(a)
fmin(a, f)
m_in(a, n, f)
mout(a)
omout(a)
fmout(a, f)
m_out(a, n, f)
MINT *a, *b, *c, *m, *q, *r;
FILE *f;
int n;
sdiv(a, n, q, r)
MINT *a, *q;
short n;
short *r;
MINT *itom(n)
DESCRIPTION
These routines perform arithmetic on integers of arbitrary length. The integers are stored using the defined type MINT. Pointers to a
MINT can be initialized using the function itom which sets the initial value to n. After that, space is managed automatically by the rou-
tines.
madd, msub and mult assign to c the sum, difference and product, respectively, of a and b. mdiv assigns to q and r the quotient and
remainder obtained from dividing a by b. sdiv is like mdiv except that the divisor is a short integer n and the remainder is placed in a
short whose address is given as r. msqrt produces the integer square root of a in b and places the remainder in r. rpow calculates in c
the value of a raised to the (``regular'' integral) power n, while pow calculates this with a full multiple precision exponent b and the
result is reduced modulo m. gcd returns the greatest common denominator of a and b in c, and invert computes c such that a*c mod b = 1,
for a and b relatively prime. mcmp returns a negative, zero or positive integer value when a is less than, equal to or greater than b,
respectively. move copies a to b. min and mout do decimal input and output while omin and omout do octal input and output. More gener-
ally, fmin and fmout do decimal input and output using file f, and m_in and m_out do I/O with arbitrary radix n. On input, records should
have the form of strings of digits terminated by a newline; output records have a similar form.
Programs which use the multiple-precision arithmetic library must be loaded using the loader flag -lmp.
FILES
/usr/include/mp.h include file
/usr/lib/libmp.a object code library
SEE ALSO dc(1), bc(1)DIAGNOSTICS
Illegal operations and running out of memory produce messages and core images.
BUGS
Bases for input and output should be <= 10.
dc(1) and bc(1) don't use this library.
The input and output routines are a crock.
pow is also the name of a standard math library routine.
4.3 Berkeley Distribution June 4, 1986 MP(3X)