1.

* and ? cannot match ____(a) /(b) $(c) .(d) / and .The question was asked during an interview.This intriguing question originated from Pattern Matching, Escaping and Quoting topic in section The Shell of Unix

Answer»

Correct answer is (d) / and .

The best I can explain: There are two THINGS which * and ? cannot match. First is, they cannot match filenames STARTING with a DOT (.). Second is, they cannot match / in the pathname. For example, we cannot use cd/usr?localto SWITCH to /usr/local. It will generate an error.



Discussion

No Comment Found

Related InterviewSolutions