Quantcast
Viewing latest article 3
Browse Latest Browse All 7

Answer by JJoao for Can grep return true/false or are there alternative methods

If we want to catch the first word of a file we need do add -zw to grep

if grep -qzw "^$1" filethen    ... else    ... fi

Without -z we get the first word of a line. Without -w we get partial words.


Viewing latest article 3
Browse Latest Browse All 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>