16 lines
234 B
Bash
16 lines
234 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
function run_cmd()
|
||
|
{
|
||
|
err_code=$(($err_code+1))
|
||
|
if [[ "$1" == "" ]]; then
|
||
|
echo "Error:Need command to run_cmd() function!"
|
||
|
exit -1
|
||
|
fi
|
||
|
$1
|
||
|
if [[ "$?" != "0" ]]; then
|
||
|
echo \"$1\" error >&2
|
||
|
exit $err_code
|
||
|
fi
|
||
|
}
|