Alright, I am assuming that rest of your script is working fine. And you are only stuck at the following section:
Finally I want to add a line after each line to ask user is this is a good file? I want to add an if statement that if the answer = Y then I can remove the line from badword.txt, I THINK I know how to create the question and if statement just don't know if there is a way to remove a specific line from the document I created...[/quote]
For this section I would suggest the following:
1. You can run the loop on the basis of number of entries you have in the file. You can get the number of entries using
cat badwords.txt | wc -l
2. In the loop you can put the question whether the file is legit or not. If a user say the file is legit then you have to do 2 things:
a. cut / awk the second section (the reason I am using cut / awk against second section because we are concentrating on content of the file) and store it in a variable
b. do an inverse match. Example: cat badwords.txt | grep -v "variable_from_section_2.a" > badwords.txt.new
3. Before ending the loop copy badwords.txt.new to badwords.txt so that for the next user that line doesn't show up.
Hope it helps.