I want to run commands in the pymol console through a bash script.How can i do it? Below is my code but it is not working.
#!/bin/bash
##
## PyMOL startup script
##
# Set PYMOL_PATH to point to this directory
export PYMOL_PATH="$(dirname "$(readlink -f "$0")")"
# other environment variables
export PYTHONHOME=$PYMOL_PATH/ext
export PYTHONPATH=$PYTHONHOME/lib/python2.7:$PYTHONHOME/lib/python2.7 /lib-tk:$PYTHONPATH
export LD_LIBRARY_PATH=$PYMOL_PATH/ext/lib:$LD_LIBRARY_PATH
export LANG=C
# binary executable
exec $PYMOL_PATH/pymol.exe "$@"
exec cmd.load("1a4g.pdb")
exec cmd.quit()
You can just make a PyMOL script in your bash script:
Alternatively, if you want to start a script from within pymol itself (PyMOL wiki)