Running Pymol console commands through Bash script

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()


Source: bash

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.