what is being done here [ "${-#*i}" != "$-" ]
===

In RHEL6 /etc/profile near the end there's an if statement:

 if [ "${-#*i}" != "$-" ];

The != I'm guessing is the "not equal" for strings comparison operator.  The left side I'm guessing is the string within the variable -@*i and the right side is the string within $- (which I think are the flags passed to the script).  This is in the middle of a for loop and $i should exist however I don't know what -#*i might possibly be.

Assuming I'm correct that $- are flags passed to the script, I'm thinking ${-#*i} must also be flags but I don't really have a clue.

Can someone please explain.  Links with list of these special variables would be appreciated too.

Thanks in advance.