Waiting for wildcard filename to exists in while loop
Hi Experts,
We are developing a script which will wait for the trigger file(with datetime in the trigger file name).
But the problem is when I use 'while' loop to wait for the file, it waits for the filename with wilcard in it that is wait for 'Trigger*.done' file.
Below is the script
This script works when I touch 'Trigger*.done' file in the source. Is there anyway to loop until the filename(with wildcard character) exists?
I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days...
The structure of the paths are like this:
/home/domains/www.domain2.com/tgp/
/home/domains/www.domain3.com/tgp/... (1 Reply)
I'm trying to do a simple if statement that tests if a filename exists with a user specified string.
So say I have these files:
Assigned_1day_after_due_chuong
Assigned_1day_after_due_gallen
Assigned_1day_after_due_heidenre
and i'm running a script and want to know if a... (6 Replies)
i have a
filename_1=file1.dat
filename_2=file2.dat
i want to pass the filename in a loop
for((i=1;i<=2;i++)
do
awk{print $1} $filename_$i.dat
done
how should i pass the filename (2 Replies)
I'm sure this is by design, but using something like
for f in dir/*
do echo $f
done
produces unexpected (to me) results if run against an empty directory. I'd have expected it to not execute the loop, but it actually calls it with f set to 'dir/*'.
Now I know that I'm trying to protect... (2 Replies)
hi
here is my script
set -vx
b=`cat /info_d05/visage/SrcFiles/Customer_Master/Log_Files/last_date.txt`
for name in /info_d05/visage/SrcFiles/Customer_Master/Input_Files/*
do
fname=`basename $name`
p=`$fname|cut -d"_" -f6|sed 's/\(.*\)....../\1/'`
if
then
cp... (6 Replies)
Practice folder contains many files and im interested in extracting file which starts with abc* ghi* xyz* . I need to do variety of operations for different files. if file starts with xyz* then i need to move to some destination otherwise some other destination. I am not able to make wildcard... (15 Replies)
In several scripts that process files matched by name pattern I needed to add a check for file existence. Just to illustrate let's say I need to process all N??? files:
/tmp$ touch N100 N101
/tmp$ l ?10
-rw-rw-r-- 1 moss group 0 Apr 19 11:22 N100
-rw-rw-r-- 1 moss group ... (10 Replies)
Hi,
I have a variable returned from Oracle SQL Function which holds file names.
I would like to test if all the file names mentioned in the string exists in a directory. If all the files exists print "exists", even if one file does not exists print "Does not exists".
e.g.
... (3 Replies)
Hi,
This has been pestering me for quite a while, any help will be highly appreciated
The current directory has a file with below name
npidata_20050523-20171210.csv
The below wildcard matched the above file
ls -ltr npidata_????????-201712??.csv
But when the part '201712' is put... (6 Replies)