Code for checking if certain no of files exists

Hi,

I am writing the shell script in ksh to check certain no of files exists,In my case there are 7 files exist like below

Sales1_timstamp.csv
Sales2_timstamp.csv
Sales3_timstamp.csv
Sales4_timstamp.csv
Sales5_timstamp.csv
Sales7_timstamp.csv
Sales7_timstamp.csv

Once all the files are available then,there is requirement to create indicator file as ind.csv

for i in "Sales1_*.csv Sales2_*.csv Sales3_*.csv Sales4_*.csv Sales5_*.csv Sales6_*.csv Sales7_*.csv" do
file := $i
if [-e $file ];then
touch ind.csv
else "no files exists"
fi

In this case even single file available ind.csv getting created,but i want to create once all files available,Kindly assist.

Seriously: DON'T register another account if one of your threads is blocked / closed for rules' violations. If your request is homework / classwork, do as required in the rules and in your other thread.
If it is not homework, explain the background of your request, e.g. the company or project you work for. If you don't, this thread will be closed as well.

User has already stated in your quoted thread this is homework. See here:

Other than "waiting for 10 files" in the other thread versus "waiting for a certain number of files" in this one i can't see any difference.

Therefore, homework rules apply and this thread is closed.

bakunin

I apologize for not noticing the other thread. My earlier post has been hidden and this user will be banned.