【发布时间】:2016-03-13 03:59:05
【问题描述】:
我在 OS X 上,根据 man bash /etc/profile 是 bash shell 的系统范围配置。
出于测试的目的,我打开了这个文件:
open_profile(){
sudo chmod 777 /etc/profile
}
并添加了一个回显,以便我可以查看它是否真的在运行。
不是:
# System-wide .profile for sh(1)
echo "test_global"
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
我在打开 bash shell 时看不到回声。
【问题讨论】:
-
chmod 777-> nonononono!永远不要运行chmod 777。它几乎从来不需要!甚至不是为了“测试目的”。如果文件是可读的,那么它是可读的。如果它可以被需要写入它的user或group写入,那么它就是可写的。绝对零需要给每个人写权限,忘记chmod让它回到正常状态正是跨国公司被黑客入侵的原因。只是不要这样做。曾经。我写了an introduction of Unix permissions。请阅读! -
你改变了你的默认外壳吗?
echo $SHELL报告什么?