如何在bash腳本中運行命令?如何在bash腳本中運行命令?
這是我的嘗試:
#!/bin/bash
project_path = "/home/user/job/project";
venv = "home/user/job/virtualenv_project";
cd $venv;
source bin/activate;
cd $project_path;
python manage.py runserver;
echo "OK!"
但不工作(project_path:沒有發現,VENV:未發現等):
#!/bin/bash
project_path="/home/user/job/project";
venv="/home/user/job/virtualenv_project";
cd "$venv";
source bin/activate;
cd "$project_path";
python manage.py runserver;
echo "OK!"
刪除'=' – anubhava
附近的空格旁註:您不需要';'在每行的末尾。 – PradyJord
@Jord謝謝你! – user3709869