为什么bashrc检查当前shell是否是交互式的?
在我的拱安装,/etc/bash.bashrc以及/etc/skel/.bashrc包含这些行: # If not running interactively, don't do anything [[ $- != *i* ]] && return 在Debian上,/etc/bash.bashrc具有: # If not running interactively, don't do anything [ -z "$PS1" ] && return 和/etc/skel/.bashrc: # If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac man bash但是,根据,非交互式shell甚至不会读取以下文件: …