$- é sinalizadores de opções atuais definidos pelo próprio shell, em invocação ou usando o comando set builtin:
$ echo $-
himBH
$ set -a
$ echo $-
ahimBH
"${-#*i}" é a sintaxe para remoção de string: (de documentação do POSIX )
${parameter#[word]}
Remove Smallest Prefix Pattern. The word shall be expanded to produce a pattern. The parameter expansion shall then result in parameter, with the smallest portion of the prefix matched by the pattern deleted. If present, word shall not begin with an unquoted '#'.
${parameter##[word]}
Remove Largest Prefix Pattern. The word shall be expanded to produce a pattern. The parameter expansion shall then result in parameter, with the largest portion of the prefix matched by the pattern deleted.
Portanto, ${-#*i} remove a string mais curta até o primeiro caractere i :
$ echo "${-#*i}"
mBH
No seu caso, if [ "${-#*i}" != "$-" ] verificar se o seu shell é interativo ou não.