|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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" |
|
#2
|
||||
|
||||
|
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.
__________________
~James [Not currently seeking freelance work] Like philosophy or interested in spirituality? Philosophorum. Game Dev Experts Forums Foresight Linux - Because your desktop should be cool! Linux FAQ FedoraFAQ UbuntuGuide |
|
#3
|
||||
|
||||
|
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?
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Problems with while loop |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|