is it possible to use input from a txt file as a variable in a shell script, basically what I want to do is take the information form a txt file (in this case a list of directory and files) and have a loop go through line by line and delete the files within the txt file;
what I would like to do is have it delete these files. My inital example script is ;
echo "Enter String To Search For"
echo "Enter directory to search in"
echo " Scanning $dir for $string"
grep -Hr $string $dir | cut -d: -f1 >> infected
cat infected | more
echo "Shall i delete these files"
if [ $ans = y] then;
if [ $ans = n] then;
for name in tim dick harry
I am looking to be able to take the for name option and use it for the main script, but pull the data from the txt file "infected" any one have any ideas?