UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 15th, 2006, 04:34 AM
Flissmitch Flissmitch is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 1 Flissmitch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 20 sec
Reputation Power: 0
Problems with while loop

Hi
I am new to Unix. I have a script which I have copied and doctored slightly and now seem to have problems with an unmatched while, and can't see the problem. Could anyone please tell me what I'm doing wrong?!
Many thanks
F

set MDSTARTJOB=3
set MDENDJOB=11
set MDCURRENTJOB=$MDSTARTJOB
set MDINPUT=0

echo -n "Starting script at: "
date
echo ""

while ( $MDCURRENTJOB <= $MDENDJOB )
echo -n "Job $MDCURRENTJOB started at: "
date
@ MDINPUT = $MDCURRENTJOB - 1
sander -O -i 1GTERM_Ome_SOLV_IONS_md_1800ps.in \
-o 1GTERM_Ome_SOLV_IONS_md$MDCURRENTJOB.out \
-p 1GTERM_Ome_SOLV_IONS_rst.prmtop
-c 1GTERM_Ome_SOLV_IONS_md$MDINPUT.rst \
-r 1GTERM_Ome_SOLV_IONS_md$MDCURRENTJOB.rst \
-x 1GTERM_Ome_SOLV_IONS_md$MDCURRENTJOB.mdcrd
echo -n "Job $MDCURRENTJOB finished at: "
date
@ MDCURRENTJOB = $MDCURRENTJOB + 1
end
echo "ALL DONE"

Reply With Quote
  #2  
Old January 15th, 2006, 04:32 PM
LinuxPenguin's Avatar
LinuxPenguin LinuxPenguin is offline
fork while true;
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2005
Location: England, UK
Posts: 5,535 LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)LinuxPenguin User rank is General (90000 - 100000 Reputation Level)  Folding Points: 11590 Folding Title: Novice Folder
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 30 m 28 sec
Reputation Power: 1008
what's your shell?

Assuming bash, you could try using 'export' instead of 'set'.

Code is also much easier to read when indented. you can use [code] tags to preserve indenting.

Reply With Quote
  #3  
Old January 16th, 2006, 07:48 AM
Ehlanna's Avatar
Ehlanna Ehlanna is offline
Not a clue what to put ...
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: in front of this keyboard
Posts: 815 Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 5 h 36 m 20 sec
Reputation Power: 243
I think you have lost the loop start and end 'commands' - shpoudl you not have a 'do' after the while and a 'done' at the end of the looping code?

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Problems with while loop


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT