What does the ${-#*i} mean in shell script? : <p>There is a for loop in the file <code>/etc/profile</code> on CentOS 6:</p>

<pre><code>for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then
            . "$i"
        else
            . "$i" &gt;/dev/null 2&gt;&amp;1
        fi
    fi
done
</code></pre>

<p>What does the <code>${-#*i}</code> mean in the above for loop?<br>
Thanks for any help.</p>
