简介 当以交互的方式使用命令行时,shell有一些特殊的内置变量,这些变量中包含一系列选项.如果在选项中包含字母i,则表示shell以交互方式运行. # case "$-" in > *i*) echo This shell is interactive;; > *) echo This shell is not interactive;; > esac以上小脚本检测是否以交互方式运行. 如果Bourne shell是登录shell,它将跟在一系列进程之后启动,然后用
原文地址 stackexchange:What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? (原文wiki链接在翻译中替换为百度百科链接.) A terminal is at the end of an electric wire, a shell is the home of a turtle, tty is a strange abbreviation and a con