[gmx-users] Re:Shell scripts

lloyd riggs lloyd.riggs at gmx.ch
Fri Jul 6 10:32:26 CEST 2012


Yes,

One is a newer 12. version Vs. 11.10.  The one PC at home just ignores the for loop, and uses it as an infanite loop over everything while the other complains of syntax (vs.12).  The one "while" loop I posted works on both, and you can also catch averidges well by $> sh script.sh >> outterminaloutput.txt  If somone is interested in averidges.  For me they're not that important, except mayby solvent  wise.  I looked at it with terminal output and realized it went on for 10,000 or more steps/iterations over g_energy but didnt notice before is why it threw me off.

Thanks

Stephan Watkins
University of Bern-Inselspital

-------- Original-Nachricht --------
> Datum: Fri, 06 Jul 2012 09:11:22 +1000
> Von: Mark Abraham <Mark.Abraham at anu.edu.au>
> An: Discussion list for GROMACS users <gmx-users at gromacs.org>
> Betreff: Re: [gmx-users] Re:Shell scripts

> On 6/07/2012 7:25 AM, lloyd riggs wrote:
> > Dear All,
> >
> > Thank you,
> >
> > I finally got this to work on the other PC after four hours...
> >
> > i=1
> > while [ $i -le 1322 ]
> > do
> > g_energy -f traj_x.edr -o ${i}.xvg << EOF
> > ${i}
> >
> > EOF
> > i=$(($i+1))
> > done
> >
> > Still can not figure out the difference, or why one works on one PC and
> not the other?
> 
> Probably different bash versions, as your Ubuntu could well be more 
> recent than some version on a server at work. Try bash --version. If so, 
> poke your system admins to make an up-to-date bash available for you, 
> even if not as the system default.
> 
> Mark
> 
> >
> > Stephan (in Rainy Switzerland)
> >
> > -------- Original-Nachricht --------
> >> Datum: Thu, 5 Jul 2012 22:25:06 +0200
> >> Von: Elton Carvalho <eltonfc at if.usp.br>
> >> An: Discussion list for GROMACS users <gmx-users at gromacs.org>
> >> Betreff: Re: [gmx-users] Re:Shell scripts
> >> On Thu, Jul 5, 2012 at 6:03 PM, lloyd riggs <lloyd.riggs at gmx.ch> wrote:
> >>> Does any one know why, or have some other scripts...
> >>>
> >>
> >> My suggestion would be something in the lines of
> >>
> >> #!/bin/bash
> >>
> >> for i in $(seq 2121) ; do
> >> g_energy -f traj_${i}.edr -o ${i}.xvg <<< "${i} 0"
> >> done
> >>
> >> ===
> >>
> >> Notice the "in" keyword right after 'i'.
> >>
> >> I used a subshell to invoke the program 'seq', which generates a
> >> sequence from 1 to the given argument, so we don't depent om how these
> >> other constructs with ((; ; )) work among different versions of bash.
> >>
> >> I also suggest replacing the here-document by a here-string, but
> >> that's personal taste. You may or may not have problems with older
> >> versions of bash
> >>
> >> Greetings from a foggy Groningen,
> >> -- 
> >> Elton Carvalho
> >> Tel.: +55 11 3091-6985/6922
> >> Dept Física dos Materiais e Mecânica
> >> Instituto de Física
> >> Universidade de São Paulo
> >> P.O. Box 66318 - 05314-970 São Paulo-SP, Brazil
> >> -- 
> >> gmx-users mailing list    gmx-users at gromacs.org
> >> http://lists.gromacs.org/mailman/listinfo/gmx-users
> >> * Only plain text messages are allowed!
> >> * Please search the archive at
> >> http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> >> * Please don't post (un)subscribe requests to the list. Use the
> >> www interface or send it to gmx-users-request at gromacs.org.
> >> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> 
> 
> -- 
> gmx-users mailing list    gmx-users at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-users
> * Only plain text messages are allowed!
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
> * Please don't post (un)subscribe requests to the list. Use the 
> www interface or send it to gmx-users-request at gromacs.org.
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists



More information about the gromacs.org_gmx-users mailing list