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.
Assign the found file to a variable, then grep it again to see if it contains ABCDEG if true then continue the while loop, if false add the note and continue the loop. Also your missing a done at the end of your while.
You need to take a step back, and read a bit on syntax first. Try the man pages and help command. $ man sh ... $ man bash ... $ help while ... $ help if ... $ help ... use / to search for a term in the man page.Eg.
Try PARAMETERS or CONDITIONAL EXPRESSIONS etc.
You are making it to complicated, I have never understood the need for compact non readable code, here is a more verbose, but never the less functional example. #! /bin/sh FILES="`find /home/anders -name \"*.
G\" -type f -print`" for file in ${FILES}; do grep ABCDEFG ${file} > /dev/null 2> /dev/null if $? -eq 0 ; then printf "Match found! \n" else printf "No match found\n" fi done.
– BeagleBoy360 Oct 5 at 21:13 On the screen, If you want it appended to the the file use printf "Match found! \n" >> ${file}, this is basic shell handling. – Anders Oct 5 at 21:14 ok, I can follow all this except that > /dev/null 2> /dev/null what is the purpose for this line of code?
– BeagleBoy360 Oct 5 at 21:21 Use grep -q if you just want to determine if the pattern is in the file.It's more efficient too, because it will exit with success upon the first match. Also, it's quiet, so you don't have to redirect: if grep -q ABCDEFG $file; then ... – glenn jackman Oct 6 at 1:45 @glenn jackman, That's correct. – Anders Oct 6 at 10:31.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.