Generating a wrong xx.gro file during Simulation of a Water Box

GROMACS version:
GROMACS modification: No
Hello everyone,
I am a new user of GROMACS who wishes to study specific radial distribution functions (RDF). So I am learning a code from starting and facing a problem during water molecule optimization.
I am generating xx.gro file using “edit_gro” script where H and O should be converted into HW1, HW2, and OW but in my case, xx.gro is generating with only HW1 for both H atoms. I am attaching files here please have a look.
********************edit_gro
awk “NR>=1 && NR<=2” water_box.gro > header
sed -i ‘1,2d’ water_box.gro
sed -i ‘n ; n ; s/ H/HW2/g’ water_box.gro
sed -i ‘s/ H /HW1 /g’ water_box.gro
sed -i ‘s/ O/OW/g’ water_box.gro
sed -i ‘s/ OW/SOL OW/g’ water_box.gro
sed -i ‘s/ HW/SOL HW/g’ water_box.gro
sed -i ‘s/0.00000/3.00000/g’ water_box.gro
cat header water_box.gro > system.gro
rm -f header


I really appreciate any help you can provide.
minim.mdp (1.0 KB)
topol.top (231 Bytes)