TenTenths |
09-29-2014 02:30 AM |
$? is the result of the last command, I'm guessing you're trying to detect if various commands worked and then run additional parts of the script accordingly.
If that's the case then your use of $? in that script is going to give you all sorts of unusual results. For example in your first "if" you're checking to see if the previous echo command worked. Same with your second, that's going to give the results of the "clear" command rather than anything else.
You can also put set -x as the second line of your script and that'll give you much more detail into how your script is executing.
|