![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Modify Perl script to work with txt - Permissions script | joangopan | Shell Programming and Scripting | 1 | 09-13-2007 12:38 AM |
| My script does not work - could you pls help? | BearCheese | Shell Programming and Scripting | 1 | 06-29-2007 06:12 AM |
| Why does this script not work? Please help | duke0001 | Shell Programming and Scripting | 4 | 02-22-2007 09:28 PM |
| Script doesn't work, but commands inside work | cheongww | UNIX for Dummies Questions & Answers | 2 | 11-14-2006 10:52 PM |
| sed script. How does it work? | billy5 | Shell Programming and Scripting | 2 | 09-02-2005 05:45 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
gcd.sh script doesn't work...
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: Code:
#!/bin/bash m=$1 n=$2 while [ "$n" != 0 ] do if [ "$m" -gt "$n" ]; #line 8 then m=$m-$n else n=$n-$m fi done echo $n and I get an error message: line 8:integer exrpession expected I run the gcd.sh writing in the terminal Code:
./gcd.sh 14 28 where 14 and 28 are integers, right? So, what's the problem? Could you please tell me what should I write? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|