There is no problem in your elif usage, as far as I can see.
But there are some missing parts in your code, so it is hard to know.
Try to create a minimal example of your problem, and post it, without '//' lines.
One problem for example may come from your
f1 = $?
lines.
There should be no spaces here (else it is interpreted as f1 command to be executed with arguments = and whatever value has $?)
Unless you do have a f1 command, that should have leaded to a "f1, command not found error", tho, not something about elif.
But if you do have a f1 command, then your if [ $f1 -eq 0 ] are executed while f1 has no value.
And since bash works by a series of substitution. that command then means if [ -eq 0 ] which leads to a syntax error.
Also, another thing we cannot verify from your partial code, is that all //do something lines must really do something. An empty line would also lead to a syntax error, since the following is incorrect
if [ condition ] ; then
elif [ anothercondition ] ; then
doSomething
fi
(This example would complain about elif being unexpected, but not expecting then)
If //do something is nothing, then use : for that (: is doing nothing)
But, well, I am speculating here. For what you gave, the only visible errors are the two fx = $? lines. And the // do something obviously, if they are literal (// is not a comment in bash), but I suppose they are not.
Oh, and unimportant side note: $10 is ok. And so is ${10}, and $9 and ${9}, hence the "unimportantness" of that remark. But there is no need to use {} specifically for two digits position parameter, as it seems your are doing :-).