What does grep return if nothing is found?

What does grep return if nothing is found?
Answer
EXIT STATUS Normally the exit status is 0 if a line is selected, 1 if no lines were selected, and 2 if an error occurred. The exit code is 1 because nothing was matched by grep. EXIT STATUS The exit status is 0 if selected lines are found, and 1 if not found. … The output is zero because the count of ‘Total’ is zero.
 

Tìm kiếm

Back
Top