鍍金池/ 問答/Linux/ 啟動(dòng)腳本表達(dá)了什么含義?

啟動(dòng)腳本表達(dá)了什么含義?

我的.bashrc中,有下面的代碼

case $- in
    *i*) ;;
      *) return;;
esac

對(duì)這個(gè)代碼不理解其邏輯:
1.如果 $- 匹配了i 字符, 什么都不做
2.如果 $- 匹配了其他,return ,什么都不做

這是什么含義?不理解

回答
編輯回答
離人歸

上一行有注釋
# If not running interactively, don't do anything

[[https://unix.stackexchange.co... bash - Why does bashrc check whether the current shell is interactive? - Unix & Linux Stack Exchange]]

2018年1月31日 00:19