User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Bash scripting syntax error Page [1]  
Specter
All American
6575 Posts
user info
edit post

Trying to write a really basic script to do some integer arithmetic and am having a problem with syntax:


let count=1
do
...
let count++
if [[ $((count%10))==0 ]] # getting a syntax error here
then echo "blah";
fi
done


i've also tried using '-eq' for equals but that doesnt appear to work. any idea what i'm doing wrong?

8/2/2010 7:50:54 PM

Specter
All American
6575 Posts
user info
edit post

nvm figured it out

8/2/2010 8:26:36 PM

ncsuapex
SpaceForRent
37776 Posts
user info
edit post

what was the problem?




[Edited on August 2, 2010 at 9:53 PM. Reason : .]

8/2/2010 9:47:46 PM

Specter
All American
6575 Posts
user info
edit post

pretty stupid, i typed it right in here but in my code i didn't have a 'then' in the if block

8/2/2010 10:05:41 PM

ncsuapex
SpaceForRent
37776 Posts
user info
edit post

A lot of times when I'm having a problem and I get to the point I need to make a thread, Im so deliberate with the steps I've taken that I actually solve the problem in the process of creating the thread. lol

8/2/2010 10:14:43 PM

 Message Boards » Tech Talk » Bash scripting syntax error Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.