Mixing Python And Bash

Thorsten Kampe thorsten at thorstenkampe.de
Mon Nov 8 20:56:13 EST 2004


* Tom Purl (2004-11-08 21:17 +0100)
> I just wrote a Python script that is going to be called from bash script.
>  If the Python script fails, I want the bash script to also stop running. 
>  Unfortunately, I can't seem to get that to work.  Here's the script so
>  far:
> 
> # custom python script
> /usr/bin/python /home/username/Dev/Python/packZODB.py \ 
>   -s"gsgmc.sigma.zettai.net" -b 7
> 
> # next program
> /usr/bin/someOtherProgram
> 
> I don't want the second program to run if the first program fails.  Isn't
> that the default in bash?  If someone could please point me in the right
> direction regarding this problem, I would really appreciate it.

Hm, not Python but bash related:

if ~/Dev/Python/packZODB.py -s"gsgmc.sigma.zettai.net" -b 7; then
    someOtherProgram; fi



More information about the Python-list mailing list