我一直在查看一些随各种Linux发行版一起提供的.bashrc和.profile脚本,并且看到有时它们会检查$-.
这是Ubuntu中的一个
case $- in
*i*) ;;
*) return;;
esac
Run Code Online (Sandbox Code Playgroud)
在这种情况下,它检查"i"标志是否存在以查看当前shell是否是交互式shell.
我当前的会议给了我这个:
# echo $-
himBH
Run Code Online (Sandbox Code Playgroud)
其他标志/选项是什么意思?某处有完整的清单吗?
| 归档时间: |
|
| 查看次数: |
1732 次 |
| 最近记录: |