我正在尝试安装根我工作需要的。我在笔记本电脑上的 virtualbox 上运行 Ubuntu 10.04 64 位。提取 tarball 后,我尝试使用自述文件中建议的命令获取 .sh 文件
$。路径名/root/bin/thisroot.sh
它向我显示以下错误:
$ . /home/username/Downloads/root/bin/thisroot.sh
bash:/home/username/Downloads/root/bin/drop_from_path: No such file or directory
bash:/home/username/Downloads/root/bin/drop_from_path: No such file or directory
bash:/home/username/Downloads/root/bin/drop_from_path: No such file or directory
bash:/home/username/Downloads/root/bin/drop_from_path: No such file or directory
bash:/home/username/Downloads/root/bin/drop_from_path: No such file or directory
bash:/home/username/Downloads/root/bin/drop_from_path: No such file or directory
bash: man: No such file or directory
Command 'dirname' is available in '/usr/bin/dirname'
The command could not be located because '/usr/bin' is not included in
the PATH environment variable.
dirname: command not found
/usr/bin/env: bash: No such file or directory
Command 'grep' is available in '/bin/grep'
The command could not be located because '/bin' is not included in the
PATH environment variable.
grep: command not found
Command 'grep' is available in '/bin/grep'
The command could not be located because '/bin' is not included in the
PATH environment variable.
grep: command not found
这样做的结果是它以某种方式删除了 PATH,因为现在我无法从命令行执行任何其他操作。例如:
$ vi README
Command 'vi' is available in '/usr/bin/vi'
The command could not be located because '/usr/bin' is not included in
the PATH environment variable.
vi: command not found
$ clear
Command 'clear' is available in '/usr/bin/clear'
The command could not be located because '/usr/bin' is not included in
the PATH environment variable.
clear: command not found
我家里的桌面上有一个 Ubuntu 11.04,安装过程很顺利。我也在我的办公室 Mac 上尝试过这个,但我不知道这里发生了什么。
答案1
如果你通过以下方式启动脚本:
. script
或者
source script
它的命令在此 shell 的上下文中执行。您不必担心路径、别名等消失;如果您稍后启动另一个 shell,该 shell 将不会受到影响。