Checking Bash exit status of several commands efficiently

You can write a function that launches and tests the command for you. Assume command1 and command2 are environment variables that have been set to a command. function mytest { “$@” local status=$? if (( status != 0 )); then echo “error with $1” >&2 fi return $status } mytest “$command1” mytest “$command2”

How to exit from Python without traceback?

You are presumably encountering an exception and the program is exiting because of this (with a traceback). The first thing to do therefore is to catch that exception, before exiting cleanly (maybe with a message, example given). Try something like this in your main routine: import sys, traceback def main(): try: do main program stuff … Read more

Difference between exit() and sys.exit() in Python

exit is a helper for the interactive shell – sys.exit is intended for use in programs. The site module (which is imported automatically during startup, except if the -S command-line option is given) adds several constants to the built-in namespace (e.g. exit). They are useful for the interactive interpreter shell and should not be used … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)