![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I would agree,its either a 0 or 1..
How ever you could use "ur command" 2> /"error file" then cat "error file" if there is any error in running the command with the arguments that you have specified then you can check the errors by visiting the "error file"... might help in debugging |
|
|||
|
1. Think about other language. Shell scripts are not designed for database manipulation.
2. You could try this: Code:
#!/bin/ksh typeset error=0 typeset retval=0 typeset my_path=$(pwd) mysql whatever 1>$$output.txt 2>$$error.txt retval=$? cd "$my_path" if [[ -s $$error.txt ]]; then error=1 fi if [[ -n $(cat $$output.txt|grep 'my error string that I am expecting') ]] ;then error=2 fi if [[ $retval -ne 0 ]] ;then return $retval else return $error fi |
|||
| Google UNIX.COM |