linux bash script running multiple python

前端 未结 2 422
广开言路
广开言路 2021-01-31 21:03

I have 2 python scripts a.py and b.py and I want to write a bash script that will load a.py and not run b.py until a.py is done doing it\'s thing. simplistically



        
2条回答
  •  礼貌的吻别
    2021-01-31 21:24

    prompt_err() {
    

    echo -e "\E[31m[ERROR]\E[m"

    }

    prompt_ok() {

    echo -e "\E[32m[OK]\E[m"

    }

    status() {

    if [ $1 -eq 0 ]; then

    prompt_ok

    else prompt_err

    exit -1

    fi

    }

    a.py

    status

    b.py

    You can use the check code above.

    If 'a.py' is done only then it will process 'b.py', otherwise it will exit with an 'Error'.

提交回复
热议问题