0

Need some helps cause I'm a newbie. My question is, how can we incorporate VMD command into bash script. I've tried doing that, but the script just stop whenever VMD finish. Any advice?

Example:

sed -i s/t912/g 4x2ns-tra*  
sed -i s/TR912/g snapshot-tra* 
sed -i s/t912/g tmextract8ns-tra.txt  
sed -i s/t912/g neu-restr-psp.tcl
sed -i s/t912/g restart-*

vmd -dispdev text XXX.pdb -e neu-restr-psp.tcl <--The script just stop here. It quits and return to terminal.

sed -i '/Boundary Conditions/{n;N;N;N;d}' 4x2ns-tra1.conf 
sed -i '/Boundary Conditions/r cellBasisVector.dat' 4x2ns-tra1.conf 
sed -i '/Boundary Conditions/{n;N;N;N;d}' 4x2ns-tra2.conf 
sed -i '/Boundary Conditions/r cellBasisVector.dat' 4x2ns-tra2.conf 
sed -i '/Boundary Conditions/{n;N;N;N;d}' 4x2ns-tra3.conf 
sed -i '/Boundary Conditions/r cellBasisVector.dat' 4x2ns-tra3.conf 
sed -i '/Boundary Conditions/{n;N;N;N;d}' 4x2ns-tra4.conf 
sed -i '/Boundary Conditions/r cellBasisVector.dat' 4x2ns-tra4.conf

Thanks

  • Why are you sure that the flow doesn't go under the `vmd` command? Did you try `echo something`? Did you try `vmd -dispdev text XXX.pdb < neu-restr-psp.tcl`? – Ruslan Osmanov Oct 06 '16 at 08:09
  • @RuslanOsmanov I've tried your suggestion but the same thing happened: Info) Opened coordinate file 0-TR862-tra4.pdb for writing. Info) Finished with coordinate file 0-TR862-tra4.pdb. Info) VMD for LINUXAMD64, version 1.9.3beta1 (July 20, 2016) Info) Exiting normally. vmd > sed: -e expression #1, char 1: unknown command: `�' sed: -e expression #1, char 1: unknown command: `�' J.J.Mariott@salx23:~/Desktop$ J.J.Mariott@salx23:~/Desktop$ J.J.Mariott@salx23:~/Desktop$ – J.J.Mariott Oct 06 '16 at 11:14
  • The line `Exiting normally` and the following `sed` errors mean that the script flow successfully passed the `vmd` command. The next step is debugging the `sed` commands. I can't find issues with the `sed` commands in your post. Maybe you skipped something. – Ruslan Osmanov Oct 06 '16 at 11:33
  • Yup. VMD was a success, but not the bash script. The script stop after VMD finish running. I dont think VMD recognize sed command. – J.J.Mariott Oct 06 '16 at 13:48
  • 1
    If `vmd` command had finished successfully (it had), then we have nothing to do with `vmd`. From the error messages above I can see that some probably unwanted sequence of bytes (`0xef 0xbf 0xbd`) bothers the `sed` command. So I suggest double checking the script, especially strings passed to `sed`. I can't help you more, because there is nothing wrong with the commands you posted _here_. You can debug the script by `set -x` (at the top of the script); the debugging output will likely help to detect the real issue. – Ruslan Osmanov Oct 06 '16 at 14:06

0 Answers0