[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:

something like this should work:
for i in Temperature Pressure ; do
g_energy -f ener.edr -o ${i}.xvg << EOF


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.


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