1.

To select lines containing gupta and agarwal, which command will be used?(a) sed -n ‘/gupta/,/agarwal/p’emp.lst(b) sed -n ‘/gupta/agarwal/p’emp.lst(c) sed ‘/gupta | agarwal’p’ emp.lst(d) sed -nThis question was posed to me by my school principal while I was bunking the class.Question is from sed command in division Filters using Regular Expressions of Unix

Answer»

Correct answer is (a) SED -n ‘/gupta/,/agarwal/p’emp.lst

Explanation: Context ADDRESSING allows us to specify ONE or two patterns to locate LINES. To do so, a separate pair of context addresses by a COMMA.



Discussion

No Comment Found

Related InterviewSolutions