[gmx-users] Re:g_energy

Oliver Stueker ostueker at gmail.com
Fri Mar 9 19:47:09 CET 2012


Hi Stephan,

Have a look at:
http://www.gromacs.org/Documentation/How-tos/Using_Commands_in_Scripts

something like this should work:
----------8><----------schnipp----------><8----------
#!/bin/bash
for i in Temperature Pressure ; do
g_energy -f ener.edr -o ${i}.xvg << EOF
${i}

EOF
done
----------8><----------schnapp----------><8----------

creating Temperature.xvg and Pressure.xvg assuming there are terms
named like this in your ener.edr file.
The braces around the i might not be necessary in this case, but don't
hurt either.

Best,
Oliver

On Fri, Mar 9, 2012 at 08:00, lloyd riggs <lloyd.riggs at gmx.ch> wrote:
>
> Dear All,
>
> Is there a way to either supress the interactive portion of g_energy and print out everything listed, or pass it to something more automated?  MY problem, I spent an hour or three trying to just write an automated four line shell or python script to extract all the terms listed based on index files.
>
> The error comes as I can not pass a variable i once the interactive portion of the g_energy is invoked (I get error $i, i '$i', "$i", etc.. does not match a pattern or whatever as an error each time).  Basically try getting a few dozen terms from an energy file, times 20 to 100 necessary runs...
>
> Sincerely,
>
> Stephan Lloyd Watkins



More information about the gromacs.org_gmx-users mailing list