Simple Git Bash .sh Script on windows to change directory does not work. Basic change directory in .sh script [closed]
Trying to make a script to automate activating a virtual environment for my django project. Here is my script which I save as 'activatevirt.sh'. The first couple lines work, but then when it gets to the lines to change directory it doesn't change the directory. Could someone please give me the exact code to implement this? I've read a few answers on here that were confusing for me and were not helpful. If someone could simply give me the exact code which would give me a script which would change the directory in git bash for windows that would excellent! Thanks.
'''
#!/bin/bash
python -m venv virt
echo testing and this line works too.
cd virt #this line doesn't work!
cd scripts # this line doesn't work either!
source activate # this line might work if it were in the right directory... not sure yet!
whoami
'''
Both cd virt
and cd scripts
use relative path definition, which can fail in case of not expected "current" directory
Detect full absolute path to /some/path/to/virt/scripts
and use it!!!