check/wait for files to exist before continuing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting check/wait for files to exist before continuing
# 1  
Old 11-20-2008
check/wait for files to exist before continuing

I'm attempting to write a pretty simple script. It opens a Filemaker file successfully. That Filemaker file takes around 30-90 seconds to finish. When it's done, it writes a few .xml files into the same directory where my shell script and the Filemaker script reside.

In my script, how can I loop/wait until the Filemaker process is finished? Basically loop until the .xml files are created, then continue.

I've tried a couple of things and searched for solutions but can't get it to wait...

Code:
# -----
open fmp_file.fp7



Thanks!
# 2  
Old 11-20-2008
Hammer & Screwdriver

What about something like this?

Code:
> cat chkf80
while [ ! -s file80 ]
  do
  printf "%10s \r" waiting 
done
echo "found it   "

# 3  
Old 11-20-2008
Code:
while [ ! -s *.xml ]
  do
  printf "." 
done
echo "found it   "

that seemed to have worked... i used the above.
thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Check if 10 files exist

Hi All, Whenever i get 10 files(file names like sales*) then another file need to create. May i know how to implement this in KSH. (4 Replies)
Discussion started by: siddireddy
4 Replies

2. UNIX for Dummies Questions & Answers

Does rsync check and ignore files that already exist?

Hi, We have two (2) servers named primary and standby. There is a directory named /db01/archive that we need to keep in-sync. Files get transferred from primary and standby. Sometimes when we do a failover or when there is a network issue, some files fail to get transferred. I want to use... (3 Replies)
Discussion started by: newbie_01
3 Replies

3. Shell Programming and Scripting

How to get script to wait until status is true before continuing?

I'm extremely new to shell scripting so I apologize for the crudeness of my descriptions. I am editing a script that will write files (e.g. Job0_A.com, Job1_A.com, etc.) and then run them through a program called gaussian (computational chemistry program). The script will then take the output files... (10 Replies)
Discussion started by: butson
10 Replies

4. Shell Programming and Scripting

Shell script to check files if exist else touch the file

Hi All, Thanks in Advance I wrote the following code if then echo "version is 1.1" for i in "subscriber promplan mapping dedicatedaccount faflistSub faflistAcc accumulator pam_account" do FILE="SDP_DUMP_$i.csv" echo "$FILE" ... (5 Replies)
Discussion started by: aealexanderraj
5 Replies

5. Shell Programming and Scripting

Check if file exist

Hi, I created following script to check if file exist: #!/bin/bash SrcDir=$1 SrcFileName=$2 SrcTimePeriod=$3 if ;then echo 1 else echo 0 fi I ran it like: /apps/Scripts/FileExist.sh /apps/Inbox file1 2nd_period_2010 Even file exist at that location, my above command is... (4 Replies)
Discussion started by: palak08
4 Replies

6. Shell Programming and Scripting

Check if file exist

Hi Does anybody know how I can check if a file exists i.e. see bellow, this doesn't work by the way and if tried countless variations on this file1=$one/file111.txt if then echo "Present" else echo "Not present" fi result : Not present (file is already present, eventhough its... (3 Replies)
Discussion started by: gksenthilkumar
3 Replies

7. Shell Programming and Scripting

check the directory exist

I have the below script to check whether directory is exist or not , now I sure the directory /abc NOT exist , but when run the script , it still pop the result is "the directory exist" , could suggest what is wrong ? thx ll -d /abc > /dev/null 2>&1 if then echo "the directory exist !!" ... (7 Replies)
Discussion started by: ust
7 Replies

8. Shell Programming and Scripting

Check if certain files exist in a directory, if not add name to a textfile

We recieve some logs on our windows box via FTP on a daily basis, in the same directory. I would like to check for missing logs files and add their name to a text file. Something like... Check if C:\logs\file1_currentdate exists (if not, add file1_currentdate to... (1 Reply)
Discussion started by: SunnyK
1 Replies

9. Shell Programming and Scripting

How to check a file exist and do a copy of other files

Hi, I would like to perform bash which would check the file A.txt to be size 0 or not. If the size is 0, I would copy file B.txt to replace A.txt. Please help. Thanks. -Jason (6 Replies)
Discussion started by: ahjiefreak
6 Replies

10. UNIX for Dummies Questions & Answers

how to check if the file exist or not?

say i would like to check if the file is existed before i use rm command. How can i do it? i know if i can use find, but i would like to have a good interface (in a shell script) thks (3 Replies)
Discussion started by: gusla
3 Replies
Login or Register to Ask a Question