LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 925|回复: 5

关于PATH变量的问题

[复制链接]
发表于 2004-8-6 10:13:12 | 显示全部楼层 |阅读模式
大家早上好,想请问大家一个问题。我原来在/etc/profile最后加上了一句
  PATH=/usr/local/jdk/binPATH
现在我卸载了jdk,然后我删除了上面那句可不可以啊,PATH变量的值会不会变为原来默认值啊?
发表于 2004-8-6 10:17:39 | 显示全部楼层
应该没什么问题!,不放心的话,先用#号把此行注释掉,然后用dot命令执行一下/etc/profile,既:
.  /etc/profile
 楼主| 发表于 2004-8-6 12:35:18 | 显示全部楼层
那请问 . /etc/profile 命令有什么作用呢?我不大明白dot命令的作用,请高手指点一下
发表于 2004-8-6 15:00:11 | 显示全部楼层
when some command is about to be executed,the global enviroment variable $PATH is searced for the command.Usually the $PATH does not include your current directory.That dot "." just tells the shell to search the current directory for the command. In your case,the dot "." tells the shell to search for the file /etc/profile which is not included in the $PATH
发表于 2004-8-6 18:05:59 | 显示全部楼层
最初由 iversion 发表
那请问 . /etc/profile 命令有什么作用呢?我不大明白dot命令的作用,请高手指点一下

简单的说,这个.命令,就是在当前shell中运行脚本文件,即,不启动另外的子shell,
.  /etc/profile的意思,就是使修改后的/etc/profile文件立即生效,而不需要重启系统!
 楼主| 发表于 2004-8-6 19:08:45 | 显示全部楼层
谢谢大家,我明白了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表