Search Results

Search: Posts Made By: biglau
1,868
Posted By methyl
Assuming we have a file called...
Assuming we have a file called "file_which_does_exist" and we do not have a file called "file_which_does_not_exist" and we are looking for a string "string". There are three possible reply codes.
...
1,868
Posted By Scrutinizer
This should work if grep -q pattern file_name ...
This should work
if grep -q pattern file_name
then
fi

or
if grep pattern file_name >/dev/null 2>&1
then
fi
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 10:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy