Question: what is $i in shell script?
Answer: $- means shell flags. ${-#*i} means shell flags minus first match of *i . If these two are not equal, then the shell is considered interactive (flag i is present). https://stackoverflow.com/questions/42058539/what-does-the-i-mean-in-shell-script/42058674#42058674.