I wrote a super simple bash script to get me into a python shell with everything set up like I need but it never actually enters the python shell. What am I doing wrong?
sudo su runnerdude
. /home/runnerdude/foo/env/bin/activate
cd /home/runnerdude/foo/bar
python manage.py shell
I think the problem is in the way sudo works. Assume your script is called run_python.sh:
Then you can invoke it with:
Or, if you insist, your script might looks like:
Note the single quotes and the backslashes to join the commands together. To run your script: