1.

For locating the first position of a character in a string we can use expr command.(a) True(b) FalseThis question was posed to me during an online exam.Question is from Case and Expr Command topic in section Essential Shell Programming of Unix

Answer»

Right answer is (a) True

The explanation: expr command can ALSO locate the first OCCURRENCE of character INSIDE a string. For example, to locate the POSITION of character d in the string ‘abdullah’, we have to COUNT the number of characters which are not ‘d’ ([^d]*),



Discussion

No Comment Found

Related InterviewSolutions