-
-
Save grhawk/b3cd79e8c1ca64d54b6af224fa3cc82f to your computer and use it in GitHub Desktop.
i-Pi input editing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To edit file in place use the '-L' option wih the ed command | |
# Name of the file to edit | |
namefile='input_hexamer_book.xml' | |
# Assign the name of the ffsocket to a variable | |
ffname=`xmlstarlet sel -t -v "/simulation/ffsocket/@name" $namefile` | |
# Add the forcefield attribute to the force tag and put $ffname as the value of the just added attribute. | |
#+Moreover remove all values from the force tag. | |
xmlstarlet ed -i "/simulation/system/forces/force" --type attr -n 'forcefield' -v $ffname -u "/simulation/system/forces/force" -v '' $namefile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment