Quantcast
Channel: Grep for This and NOT That in a File? - Super User
Viewing all articles
Browse latest Browse all 4

Answer by Rich Homolka for Grep for This and NOT That in a File?

$
0
0

this should work:

FIRST=addDesignControlChangeNotificationSECOND=removeDesignControlChangeNotificationgrep -l $FIRST * | while IFS= read -r FILEdo    grep $SECOND "$FILE"&> /dev/null    if [ $? -ne 0 ]    then        echo "File $FILE has $FIRST but not $SECOND"    fidone

Viewing all articles
Browse latest Browse all 4

Trending Articles