bash:files:search_files_for_specific_text
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
bash:files:search_files_for_specific_text [2021/01/26 16:38] – peter | bash:files:search_files_for_specific_text [2021/01/26 16:41] (current) – peter | ||
---|---|---|---|
Line 30: | Line 30: | ||
done < file.txt | done < file.txt | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Read and Testing return status ===== | ||
+ | |||
+ | <code bash> | ||
+ | while read line; do let c++; echo $line | grep test >/ | ||
+ | if [[ $? == 0 ]] ; then echo Match for line $c : $line; | ||
+ | else echo No match for line $c; fi | ||
+ | done < file.txt | ||
+ | </ | ||
+ | |||
bash/files/search_files_for_specific_text.1611679125.txt.gz · Last modified: 2021/01/26 16:38 by peter