我的理解是它.bash_profile总是通过 SSH 登录来调用。
但是,除非执行以下操作,否则我看不到启用的各种设置:
ssh $host "source ~/.bash_profile ; echo $PATH "
.:/mnt/spark-1.4.1/bin:/mnt/spark-1.4.1/sbin:/mnt/scala-2.11.2/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Run Code Online (Sandbox Code Playgroud)
当我简单地这样做时:
ssh $host "echo $PATH "
Run Code Online (Sandbox Code Playgroud)
PATH 信息只是默认的
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Run Code Online (Sandbox Code Playgroud)
用户是 root,默认 shell 是 bash。
$ ll /bin/sh
lrwxrwxrwx 1 root root 4 Aug 6 19:54 /bin/sh -> bash
Run Code Online (Sandbox Code Playgroud)
更新root 的 shell为bash
grep root /etc/passwd
root:x:0:0:root:/root:/bin/bash
Run Code Online (Sandbox Code Playgroud)
你有.bashrc文件集吗?它可能会被损坏或损坏,或者有一些导致处理.bashrc阻塞和失败的东西。结果,\xe2\x80\x99t 无法达到可以干净地消化/处理的程度.bash_profile。
如本网站所示,.bashrc之前加载.bash_profile:
| 互动登录 | 交互式非登录 | 脚本 | |
|---|---|---|---|
/etc/profile | A | ||
/etc/bash.bashrc | A | ||
~/.bashrc | 乙 | ||
~/.bash_profile | B1 | ||
~/.bash_login | B2 | ||
~/.profile | B3 | ||
BASH_ENV | A | ||
~/.bash_logout | C |
我建议检查这一点.bashrc,甚至可能暂时将其重命名.bashrc_off为禁用它以在进一步调试之前测试理论。
| 归档时间: |
|
| 查看次数: |
18325 次 |
| 最近记录: |