So I am trying to create a script that launches a urxvt
terminal and sourcing a venv/bin/activate
python env at the same time like this:
virtualenv -p /usr/bin/python2.7 /tmp/venv;
urxvt -e sh -c "bash -c 'source /tmp/venv/bin/activate'; bash"
I cannot get it to work for some reason.
Does anyone know another way to achieve this?
The problem with the command
is that the 1st bash sources
activate
script and then exits so the second bash doesn't start in the venv being activated. Run the second bash inside-c '…'
with the venv activated:PS. I love to use
exec
to replace the current shell instead of making it fork and wait. Saves a few processor cycles and a few bytes of memory.