当前位置: 技术问答>linux和unix
请问一个关于shell script的问题
来源: 互联网 发布时间:2016-11-20
本文导语: #!/bin/bash # Program: # User input a filename, program will check the flowing: # 1.) exist? 2.) file/directory? 3.) file permissions # History: # 2011/04/06 xspFirst release PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin expo...
#!/bin/bash # Program:
# User input a filename, program will check the flowing:
# 1.) exist? 2.) file/directory? 3.) file permissions
# History:
# 2011/04/06 xspFirst release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
这句是方便在脚本中呼叫其他方法时不用使用其他路径
但是下面那个export PATH这个的作用是什么呢
# User input a filename, program will check the flowing:
# 1.) exist? 2.) file/directory? 3.) file permissions
# History:
# 2011/04/06 xspFirst release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
这句是方便在脚本中呼叫其他方法时不用使用其他路径
但是下面那个export PATH这个的作用是什么呢
|
就是export PATH=//bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
把变量的设置导入环境变量中
|
就是将这个变量导出,让接下来所有得shell都可以用他
|
将变量导出,
PATH=//bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
PATH=//bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin