nerdexam
Oracle

1Z0-821 · Question #6

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…

The correct answer is E. The command /user/sbin/useradd will execute, because it is the first match in the search path. See the full explanation below for the reasoning.

Question

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?

Options

  • AHe will get a "file not found" error, because the current directory is not in his seaech path.
  • BHe will get a "file not found" error, because his home directory is not in his search path.
  • CThe useradd script will execute, because jack is in the same directory that the script is located in.
  • DThe command /user/sbin/useradd will execute, because it is the last match in the search path.
  • EThe command /user/sbin/useradd will execute, because it is the first match in the search path.

How the community answered

(55 responses)
  • A
    16% (9)
  • B
    2% (1)
  • C
    4% (2)
  • D
    5% (3)
  • E
    73% (40)

Community Discussion

No community discussion yet for this question.

Full 1Z0-821 Practice