Oracle Solaris 11 Advanced System Administrator — Question 2
A user jack, using a korn shell, requests a directory listing as follows: jack@solaris:/export/home/jack $ 1s
File filea Filea fileb Fileb filec Filec
Which two statements are correct?
Answer options
- A. The pattern [?i]*a will expand to filea Filea.
- B. The pattern [fF]*a? will expand to [fF] *a?.
- C. The pattern [gfe] * will expand to file filea fileb filec.
- D. The pattern [g-e] * will expand to file filea fileb filec.
- E. The pattern [fF] [a-zA-z] i*e will expand to file.
Correct answer: A, C
Explanation
The correct answer A is valid because the pattern [?i]*a matches both filea and Filea due to the case-insensitivity of the first character and the wildcard for any character. Option C is incorrect because the pattern [gfe]* does not match any files starting with the characters g, f, or e. Both A and C are correct statements regarding the expansion of the specified patterns.