From: Josh (vermaasj_at_msu.edu)
Date: Thu Nov 02 2023 - 15:36:48 CDT

Hi Yixin,

Did you change the tkConsole to run bash? I did not know this was
possible. The rmsd.tcl script is meant to be interpreted by a tcl
interpreter. I don't think this is happening, since the tcl interpreter
never reports a line number when it throws an error, much to my
annoyance. Are you opening the tkConsole from the Extensions menu? Or
are you putting the command directly into the terminal that opens when
VMD opens?

-Josh

On 10/31/23 11:55 AM, Yixin Chen wrote:
> Dear all,
>
> I am a beginner of VMD and NAMD, I follow the NAMD TUTORIAL to study.
> I am in the section of 1.8 Analysis of Water Sphere Equilibration
> when I run the rmsd.tcl on Tk Console, there is an error:/ bad for
> loop variable/. to handle the error I use sudo dpkg-reconfigure dash
> and select no to Change the default shell to bash.
> After the chage, the error is also changed : /line 7: syntax error
> near unexpected token `i' and line 7: `for {set i 1} {$i <= $nf} {incr
> i} {'/
> Is there anyone who could help me to find the problem, thank you so much!
>
> I use the Ubuntu 22.04.3 64 ; NAMD 3.0b4 linux x86_64; vmd-1.9.4a57
> the rmsd.tcl file is get from  required tutorial files witch download
> from the the web.
> the code is:
> /set outfile [open rmsd.dat w]
> set nf [molinfo top get numframes]
> set frame0 [atomselect top "protein and backbone and noh" frame 0]
> set sel [atomselect top "protein and backbone and noh"]
> # rmsd calculation loop
> for { set i 1 } { $i <= $nf } { incr i } {
> $sel frame $i
> $sel move [measure fit $sel $frame0]
> puts $outfile "[measure rmsd $sel $frame0]"
> }
> close $outfile/
> /
> /
> Best regards,
> Yixin

-- 
Josh Vermaas
vermaasj_at_msu.edu
Assistant Professor, Plant Research Laboratory and Biochemistry and Molecular Biology
Michigan State University
vermaaslab.github.io