Hi,
I am trying to count the number of times a string of letters occurs in a file for multiple unique strings of letters. Right now I can do this one at a time using the following code (in this example I am searching for the string "AAA"):
The issue is that I have several thousand of these unique strings of letters to search for and would like to automate things a bit. I have tried adding a #!/bin/bash to the beginning of a file containing multiple search terms but nothing happens when I execute the file. Here is an example:
Most likely, something does happen when you execute your script. But since nothing is printed on your terminal, you feel as if nothing happens.
Every command in your script is followed by the redirection operator (the ">>") and hence the output of every command is redirected to the file "outfile.txt". So, by the time the script finishes its execution, the "outfile.txt" gets filled up.
You can check that by printing the content of "outfile.txt" after executing your script.
durden_tyler,
Thank you for your response. I have checked and the outfile.txt is not created suggesting nothing is run. I've gone ahead and just cut and pasted my commands into the terminal and got things finished but moving forward I'd like to get this working.
Thanks!