当前位置: 技术问答>linux和unix
linux 的一道看不懂的题目。。求
来源: 互联网 发布时间:2016-12-11
本文导语: 26. PATH = /bin : /usr : /yourhome The file /bin/calender has the following line in it cal 10 1997 The file /yourhome/calender has the following line in it cal 5 1997 If the current directory is /yourhome and calender is executed a)...
26. PATH = /bin : /usr : /yourhome
The file /bin/calender has the following line in it
cal 10 1997
The file /yourhome/calender has the following line in it
cal 5 1997
If the current directory is /yourhome and calender is executed
a) The calendar for May 1997 will be printed on screen
b) The calendar for Oct 1997 will be printed on screen
c) The calendar for the current month( whatever it is) will be printed
d) Nothing will get printed on screen
什么意思。。。能解释一下伐。。。选哪个
The file /bin/calender has the following line in it
cal 10 1997
The file /yourhome/calender has the following line in it
cal 5 1997
If the current directory is /yourhome and calender is executed
a) The calendar for May 1997 will be printed on screen
b) The calendar for Oct 1997 will be printed on screen
c) The calendar for the current month( whatever it is) will be printed
d) Nothing will get printed on screen
什么意思。。。能解释一下伐。。。选哪个
|
答案B
当前工作目录是/yourhome,执行calender,由于没有指定calender的路径,因此会读取PATH环境变量并按定义的顺序进行查找,PATH变量中最优先查找的是/bin,马上找到/bin/calender并执行。
如果在/yourhome目录中执行./calender,答案将是A.
当前工作目录是/yourhome,执行calender,由于没有指定calender的路径,因此会读取PATH环境变量并按定义的顺序进行查找,PATH变量中最优先查找的是/bin,马上找到/bin/calender并执行。
如果在/yourhome目录中执行./calender,答案将是A.