Im trying to make a script that looks for all files in a directory that ends in .g and then once it finds that file, it will look for “ABCDEFG” in the file.
If the the file has “ABCDEFG” in it, it will display make a note in the file Found only if it does not have “ABCDEFG” already.
This is a practice question for school i just cant get done.
#!/bin/sh
while [grep -l *.g != 0]
file = grep -l *.g
grep -i ‘[ABCDEFG]*$’ /usr/dict/$file
this is where i am stuck.
Try
grep -c ABCDEFG *.g | grep ‘:1$’
As a good starting point to get a list of files that end .* and only have ABC… in it once.