Closed ohsOllila closed 1 year ago
It is to check if gmx trjconv was successful.
As you know, it used to be that the gromacs modules gave out this "Gromacs cool quote", in front of which the letters gcq were printed, if the command exited successfully. However, I think this text was changed to GROMACS reminds you or something like that in the very latest versions. Which I find annoying, as all my scripts have been using this gcq-check.
To avoid future pains with this, it might be best to avoid grepping the gmx outputs altogether.
Unfortunately $#
does not seem to work:
kuvaja:PST bb$ gmx help trjconv >& /dev/null
kuvaja:PST bb$ echo $#
0
kuvaja:PST bb$ gmx trjconv >& /dev/null
kuvaja:PST bb$ echo $#
0
kuvaja:PST bb$
However, this seems to work, at least in bash:
kuvaja:PST bb$ gmx help trjconv >& /dev/null
kuvaja:PST bb$ echo $PIPESTATUS
0
kuvaja:PST bb$ gmx trjconv >& /dev/null
kuvaja:PST bb$ echo $PIPESTATUS
1
kuvaja:PST bb$
Found it from here with the help of Matti.
I have commented now the lines which did not work with new gromacs version https://github.com/NMRLipids/MATCH/commit/7cba79b829bdf1433184564888accaa35ef80a3c
We can consider some other checking method, but one receives error messages anyway if some part of the script is not successful because subsequent steps depend on the output.
What is this line for:
https://github.com/NMRLipids/MATCH/blob/1488df51148a165fb1f3201418470098d0bc3373/scripts/centerTheBilayer.sh#L35
?