Which of the following pattern is used for extracting a substring using expr?

Ẽm Thư

New member
Which of the following pattern is used for extracting a substring using expr?
A. /( )
B. \(. .\)
C. . .\)
D. \\(
 
Answer: b
Explanation: expr can extract a substring enclosed by the escaped characters \ ( and \). For example, to extract ‘03’ from the string 2003 use the following command:
Code:
$ str= 2003
$ expr “$str” :  ‘. .\(. .\)’
03
 

Tìm kiếm

Back
Top