Gmx tools: Writing output to shell variable instead of file

GROMACS version: 2019.6
GROMACS modification: No
Here post your question:
Is it possible to save output of a gromacs tool to a shell variable instead of a file? How?
For example, I have 100,000 gro files and want the sasa for each configuration
echo 2 | gmx sasa -o area.xvg -f 1.gro -s 1.gro

I want to do something like:
echo 2 | gmx sasa -o “direct to shell variable” -f 1.gro -s 1.gro &> /dev/null
(This reduces direction of result to output stream… this becomes an issue when my shell script launches 16 processes of sasa in parallel… I can hear my hard disk scream with all the I/O )


I believe this is not possible. An alternative solution could be to write the output files to a RAM disk, instead of to your hard drive. You can then copy the files to your hard drive if needed. If you’re running on Linux, such directories are very easy to set up, but I believe it’s also possible on Windows.


1 Like