I want to write a script to activate a virtual environment and run my server for Django project in a new terminal. My startProject.sh is:
#!/bin/bash
source virtualenv/bin/activate
python manage.py runserver
And, I can run this script on my current terminal by:
source startProject.sh
I want to do this in a new terminal opened by a script.
#!/bin/bash
gnome-terminal --working-directory=/home/myname/project -x 'source startProject.sh'
I tried this too.
#!/bin/bash
gnome-terminal --working-directory=/home/myname/project -x '#!/bin/bash\n source startProject.sh'
Both do not work. Why? I read other questions but I still did not get it. I am a beginner, so please assume no experience.
gnome-terminal --working-directory=/home/myname/project -x './startProject.sh'
...'source startProject.sh'
.