User jack, whose account is configured to use the korn shell, logs in and examines the value of his
PATH environment variable:
jack@solaris: echo $PATH
/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin
There is a shell script in jack’s home directory called useradd:
-r-xr-xr-x 2 jack other 1239 2012-01-05 11:42 useradd
While in his home directory, jack attempts to run the script:
jack@solaris: useradd
What will happen, and why?
A.
He will get a “file not found” error, because the current directory is not in his seaech path.
B.
He will get a “file not found” error, because his home directory is not in his search path.
C.
The useradd script will execute, because jack is in the same directory that the script is located
in.
D.
The command /user/sbin/useradd will execute, because it is the last match in the search path.
E.
The command /user/sbin/useradd will execute, because it is the first match in the search path.
E is correct?
Yes, E is correct!
I think E too but I’m not sure
D is correct
D
Why D – last match? common senes says – I search search I found it I run it and stop searching. So the first found is run. So E is correct, right?