A
A
Andrew Vityuk2017-06-21 12:51:17
linux
Andrew Vityuk, 2017-06-21 12:51:17

How to setup smart search via egrep?

Hello. There is a configured search, I want to modernize it, this is how it looks now

egrep -c -i -U "dev"

I have a script in which a check is run from time to time, if there is such a name, then the script considers it to be correct and continues to work. And you need to do the opposite, so that the script checks if, for example, there is a name master , if it is not there, then it continues to work, and if there is, then let it stop. Tell me how this can be done.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor Taran, 2017-06-21
@z_i_z_u

egrep -c -i -U "dev" || echo "гре ничего не нашел и вернул статус фейл"

another option
grep -q -ciU - returns status 0 if the search is successful.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question