I am writing a bash/shell script to automate some file filtering functions. Here is what I have written so far. Its based of a script I found online.
if (( $(ps -ef | grep $service | wc -l) > 0 )) then echo "$service is not done" >> /root/test.txt else (( $(wc -l /root/filter/first.txt) > 0 )) if (( $(ps -ef | grep $service | wc -l) < 0 )) then ./root/filter/filefilter.sh else (( $(ls | grep /root/filter/final.txt | wc -l) > 0 )) if (( $(ps -ef | grep awk | wc -l) > 0 )) then (( $(ls | grep /root/filter/final.txt | wc -l) > 0 )) else # here is where I would like it to loop until the filtering is complete # then once the final file is > 0 stop/die/done fi fi fi
I would like it loop until the final.txt has been created in the dir, I will add that part in, just need assistance on the loop or return function ( if return can be used to return to line 1 and start running the script again until the final.txt is created then die/done/stop)