How to wait for all files and copy into dir

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have 3 files which will come everyday with date in file name.
I need to check all 3 files date if matching with today's date.
and need to wait for 3 files, because all files may not come at same time.
if all file arrives then only need to copy all 3 files to target directory.



below sample code is working for all files if available. but i need to make some while loop or something sleep command where my script can wait/look for all 3 files in src dir then move all together.



#!/bin/ksh
src_dir=/data/SIN/src;
tgt_dir=/data/SIN/tmp;
cd $src_dir;
RUN_DATE=`date +%Y%m%d`;

file1=file1_$RUN_DATE.txt
file2=file2_$RUN_DATE.txt
file3=file3_$RUN_DATE.txt

file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l` ;

if [ "$file_count" == 3 ]
then
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
else
echo "file missing";
fi









share|improve this question























  • If you know all three filenames, then just test for existence of those three filenames.
    – Kusalananda
    Aug 31 at 9:21










  • you could try sleep 60 && sh basename "$0" ` instead of echo "file missing"
    – msp9011
    Aug 31 at 9:26















up vote
0
down vote

favorite












I have 3 files which will come everyday with date in file name.
I need to check all 3 files date if matching with today's date.
and need to wait for 3 files, because all files may not come at same time.
if all file arrives then only need to copy all 3 files to target directory.



below sample code is working for all files if available. but i need to make some while loop or something sleep command where my script can wait/look for all 3 files in src dir then move all together.



#!/bin/ksh
src_dir=/data/SIN/src;
tgt_dir=/data/SIN/tmp;
cd $src_dir;
RUN_DATE=`date +%Y%m%d`;

file1=file1_$RUN_DATE.txt
file2=file2_$RUN_DATE.txt
file3=file3_$RUN_DATE.txt

file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l` ;

if [ "$file_count" == 3 ]
then
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
else
echo "file missing";
fi









share|improve this question























  • If you know all three filenames, then just test for existence of those three filenames.
    – Kusalananda
    Aug 31 at 9:21










  • you could try sleep 60 && sh basename "$0" ` instead of echo "file missing"
    – msp9011
    Aug 31 at 9:26













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have 3 files which will come everyday with date in file name.
I need to check all 3 files date if matching with today's date.
and need to wait for 3 files, because all files may not come at same time.
if all file arrives then only need to copy all 3 files to target directory.



below sample code is working for all files if available. but i need to make some while loop or something sleep command where my script can wait/look for all 3 files in src dir then move all together.



#!/bin/ksh
src_dir=/data/SIN/src;
tgt_dir=/data/SIN/tmp;
cd $src_dir;
RUN_DATE=`date +%Y%m%d`;

file1=file1_$RUN_DATE.txt
file2=file2_$RUN_DATE.txt
file3=file3_$RUN_DATE.txt

file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l` ;

if [ "$file_count" == 3 ]
then
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
else
echo "file missing";
fi









share|improve this question















I have 3 files which will come everyday with date in file name.
I need to check all 3 files date if matching with today's date.
and need to wait for 3 files, because all files may not come at same time.
if all file arrives then only need to copy all 3 files to target directory.



below sample code is working for all files if available. but i need to make some while loop or something sleep command where my script can wait/look for all 3 files in src dir then move all together.



#!/bin/ksh
src_dir=/data/SIN/src;
tgt_dir=/data/SIN/tmp;
cd $src_dir;
RUN_DATE=`date +%Y%m%d`;

file1=file1_$RUN_DATE.txt
file2=file2_$RUN_DATE.txt
file3=file3_$RUN_DATE.txt

file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l` ;

if [ "$file_count" == 3 ]
then
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
else
echo "file missing";
fi






shell-script shell






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 5 at 2:21









Rui F Ribeiro

36.8k1272117




36.8k1272117










asked Aug 31 at 9:13









goldenbutter

31




31











  • If you know all three filenames, then just test for existence of those three filenames.
    – Kusalananda
    Aug 31 at 9:21










  • you could try sleep 60 && sh basename "$0" ` instead of echo "file missing"
    – msp9011
    Aug 31 at 9:26

















  • If you know all three filenames, then just test for existence of those three filenames.
    – Kusalananda
    Aug 31 at 9:21










  • you could try sleep 60 && sh basename "$0" ` instead of echo "file missing"
    – msp9011
    Aug 31 at 9:26
















If you know all three filenames, then just test for existence of those three filenames.
– Kusalananda
Aug 31 at 9:21




If you know all three filenames, then just test for existence of those three filenames.
– Kusalananda
Aug 31 at 9:21












you could try sleep 60 && sh basename "$0" ` instead of echo "file missing"
– msp9011
Aug 31 at 9:26





you could try sleep 60 && sh basename "$0" ` instead of echo "file missing"
– msp9011
Aug 31 at 9:26











2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










You're so close, just switching your if statement with a while loop, or just adding a while loop as you suggest should do the trick for you.



#!/bin/ksh
src_dir=/data/SIN/src;
tgt_dir=/data/SIN/tmp;
cd $src_dir;
RUN_DATE=`date +%Y%m%d`;

file1=file1_$RUN_DATE.txt
file2=file2_$RUN_DATE.txt
file3=file3_$RUN_DATE.txt

file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l` ;

# check every 5 seconds if the files are all there
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
done

if [ "$file_count" == 3 ]
then
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
else
echo "file missing";
fi


This would work, though it would hang should there ever be more than 3 files in that dir, or if one or more of the files never turn up. So I'd recommend adding a break to the while loop:



# check every 5 seconds if the files are all there, up to 10 times
count=0
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
found_files=$(ls -lrt $src_dir/*.txt | grep $RUN_DATE)
echo -e "files found:nt$found_files" # print the files that have been found so you know which are missing
((count++))
if [ "$count" = 10 ]; then
break
fi
done





share|improve this answer






















  • thanks everyone.... both of you answer is correct. i was new for loop, so have idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:45










  • I've edited my answer, so that it will print the files that have been found, so you know which are missing whilst the while loop is running.
    – RobotJohnny
    Aug 31 at 12:10

















up vote
1
down vote













try



file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)

while [ "$file_count" != 3 ]
do
echo "file missing";
sleep 60
file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)
else
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
return

done


note that



  • it is a bad idea to parse ls's output, unless you sure you don't hava any funny char (space, new line ...)

  • I replaced grep | wc -l by grep -c which do the same

  • In same way I replaced back quote by $( )


Edit : which file is missing ?



replace



echo "file missing";


by



test -f $src_dir/$file1 || echo $file1 missing
test -f $src_dir/$file2 || echo $file2 missing
test -f $src_dir/$file3 || echo $file3 missing





share|improve this answer






















  • thanks for help.....both of your answer is correct. i was new for loop, so have little idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:46










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f465968%2fhow-to-wait-for-all-files-and-copy-into-dir%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










You're so close, just switching your if statement with a while loop, or just adding a while loop as you suggest should do the trick for you.



#!/bin/ksh
src_dir=/data/SIN/src;
tgt_dir=/data/SIN/tmp;
cd $src_dir;
RUN_DATE=`date +%Y%m%d`;

file1=file1_$RUN_DATE.txt
file2=file2_$RUN_DATE.txt
file3=file3_$RUN_DATE.txt

file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l` ;

# check every 5 seconds if the files are all there
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
done

if [ "$file_count" == 3 ]
then
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
else
echo "file missing";
fi


This would work, though it would hang should there ever be more than 3 files in that dir, or if one or more of the files never turn up. So I'd recommend adding a break to the while loop:



# check every 5 seconds if the files are all there, up to 10 times
count=0
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
found_files=$(ls -lrt $src_dir/*.txt | grep $RUN_DATE)
echo -e "files found:nt$found_files" # print the files that have been found so you know which are missing
((count++))
if [ "$count" = 10 ]; then
break
fi
done





share|improve this answer






















  • thanks everyone.... both of you answer is correct. i was new for loop, so have idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:45










  • I've edited my answer, so that it will print the files that have been found, so you know which are missing whilst the while loop is running.
    – RobotJohnny
    Aug 31 at 12:10














up vote
0
down vote



accepted










You're so close, just switching your if statement with a while loop, or just adding a while loop as you suggest should do the trick for you.



#!/bin/ksh
src_dir=/data/SIN/src;
tgt_dir=/data/SIN/tmp;
cd $src_dir;
RUN_DATE=`date +%Y%m%d`;

file1=file1_$RUN_DATE.txt
file2=file2_$RUN_DATE.txt
file3=file3_$RUN_DATE.txt

file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l` ;

# check every 5 seconds if the files are all there
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
done

if [ "$file_count" == 3 ]
then
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
else
echo "file missing";
fi


This would work, though it would hang should there ever be more than 3 files in that dir, or if one or more of the files never turn up. So I'd recommend adding a break to the while loop:



# check every 5 seconds if the files are all there, up to 10 times
count=0
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
found_files=$(ls -lrt $src_dir/*.txt | grep $RUN_DATE)
echo -e "files found:nt$found_files" # print the files that have been found so you know which are missing
((count++))
if [ "$count" = 10 ]; then
break
fi
done





share|improve this answer






















  • thanks everyone.... both of you answer is correct. i was new for loop, so have idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:45










  • I've edited my answer, so that it will print the files that have been found, so you know which are missing whilst the while loop is running.
    – RobotJohnny
    Aug 31 at 12:10












up vote
0
down vote



accepted







up vote
0
down vote



accepted






You're so close, just switching your if statement with a while loop, or just adding a while loop as you suggest should do the trick for you.



#!/bin/ksh
src_dir=/data/SIN/src;
tgt_dir=/data/SIN/tmp;
cd $src_dir;
RUN_DATE=`date +%Y%m%d`;

file1=file1_$RUN_DATE.txt
file2=file2_$RUN_DATE.txt
file3=file3_$RUN_DATE.txt

file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l` ;

# check every 5 seconds if the files are all there
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
done

if [ "$file_count" == 3 ]
then
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
else
echo "file missing";
fi


This would work, though it would hang should there ever be more than 3 files in that dir, or if one or more of the files never turn up. So I'd recommend adding a break to the while loop:



# check every 5 seconds if the files are all there, up to 10 times
count=0
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
found_files=$(ls -lrt $src_dir/*.txt | grep $RUN_DATE)
echo -e "files found:nt$found_files" # print the files that have been found so you know which are missing
((count++))
if [ "$count" = 10 ]; then
break
fi
done





share|improve this answer














You're so close, just switching your if statement with a while loop, or just adding a while loop as you suggest should do the trick for you.



#!/bin/ksh
src_dir=/data/SIN/src;
tgt_dir=/data/SIN/tmp;
cd $src_dir;
RUN_DATE=`date +%Y%m%d`;

file1=file1_$RUN_DATE.txt
file2=file2_$RUN_DATE.txt
file3=file3_$RUN_DATE.txt

file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l` ;

# check every 5 seconds if the files are all there
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
done

if [ "$file_count" == 3 ]
then
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
else
echo "file missing";
fi


This would work, though it would hang should there ever be more than 3 files in that dir, or if one or more of the files never turn up. So I'd recommend adding a break to the while loop:



# check every 5 seconds if the files are all there, up to 10 times
count=0
while [ "$file_count" -ne 3 ]; do
sleep 5
file_count=`ls -lrt $src_dir/*.txt | grep $RUN_DATE | wc -l`
found_files=$(ls -lrt $src_dir/*.txt | grep $RUN_DATE)
echo -e "files found:nt$found_files" # print the files that have been found so you know which are missing
((count++))
if [ "$count" = 10 ]; then
break
fi
done






share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 31 at 12:10

























answered Aug 31 at 9:25









RobotJohnny

702216




702216











  • thanks everyone.... both of you answer is correct. i was new for loop, so have idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:45










  • I've edited my answer, so that it will print the files that have been found, so you know which are missing whilst the while loop is running.
    – RobotJohnny
    Aug 31 at 12:10
















  • thanks everyone.... both of you answer is correct. i was new for loop, so have idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:45










  • I've edited my answer, so that it will print the files that have been found, so you know which are missing whilst the while loop is running.
    – RobotJohnny
    Aug 31 at 12:10















thanks everyone.... both of you answer is correct. i was new for loop, so have idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
– goldenbutter
Aug 31 at 11:45




thanks everyone.... both of you answer is correct. i was new for loop, so have idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
– goldenbutter
Aug 31 at 11:45












I've edited my answer, so that it will print the files that have been found, so you know which are missing whilst the while loop is running.
– RobotJohnny
Aug 31 at 12:10




I've edited my answer, so that it will print the files that have been found, so you know which are missing whilst the while loop is running.
– RobotJohnny
Aug 31 at 12:10












up vote
1
down vote













try



file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)

while [ "$file_count" != 3 ]
do
echo "file missing";
sleep 60
file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)
else
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
return

done


note that



  • it is a bad idea to parse ls's output, unless you sure you don't hava any funny char (space, new line ...)

  • I replaced grep | wc -l by grep -c which do the same

  • In same way I replaced back quote by $( )


Edit : which file is missing ?



replace



echo "file missing";


by



test -f $src_dir/$file1 || echo $file1 missing
test -f $src_dir/$file2 || echo $file2 missing
test -f $src_dir/$file3 || echo $file3 missing





share|improve this answer






















  • thanks for help.....both of your answer is correct. i was new for loop, so have little idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:46














up vote
1
down vote













try



file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)

while [ "$file_count" != 3 ]
do
echo "file missing";
sleep 60
file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)
else
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
return

done


note that



  • it is a bad idea to parse ls's output, unless you sure you don't hava any funny char (space, new line ...)

  • I replaced grep | wc -l by grep -c which do the same

  • In same way I replaced back quote by $( )


Edit : which file is missing ?



replace



echo "file missing";


by



test -f $src_dir/$file1 || echo $file1 missing
test -f $src_dir/$file2 || echo $file2 missing
test -f $src_dir/$file3 || echo $file3 missing





share|improve this answer






















  • thanks for help.....both of your answer is correct. i was new for loop, so have little idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:46












up vote
1
down vote










up vote
1
down vote









try



file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)

while [ "$file_count" != 3 ]
do
echo "file missing";
sleep 60
file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)
else
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
return

done


note that



  • it is a bad idea to parse ls's output, unless you sure you don't hava any funny char (space, new line ...)

  • I replaced grep | wc -l by grep -c which do the same

  • In same way I replaced back quote by $( )


Edit : which file is missing ?



replace



echo "file missing";


by



test -f $src_dir/$file1 || echo $file1 missing
test -f $src_dir/$file2 || echo $file2 missing
test -f $src_dir/$file3 || echo $file3 missing





share|improve this answer














try



file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)

while [ "$file_count" != 3 ]
do
echo "file missing";
sleep 60
file_count=$(ls -lrt $src_dir/*.txt | grep -c $RUN_DATE)
else
echo "all 3 files are available";
cp $src_dir/$file1 $tgt_dir;
cp $src_dir/$file2 $tgt_dir;
cp $src_dir/$file3 $tgt_dir;
echo "files copied";
return

done


note that



  • it is a bad idea to parse ls's output, unless you sure you don't hava any funny char (space, new line ...)

  • I replaced grep | wc -l by grep -c which do the same

  • In same way I replaced back quote by $( )


Edit : which file is missing ?



replace



echo "file missing";


by



test -f $src_dir/$file1 || echo $file1 missing
test -f $src_dir/$file2 || echo $file2 missing
test -f $src_dir/$file3 || echo $file3 missing






share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 31 at 13:02

























answered Aug 31 at 9:26









Archemar

19.1k93467




19.1k93467











  • thanks for help.....both of your answer is correct. i was new for loop, so have little idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:46
















  • thanks for help.....both of your answer is correct. i was new for loop, so have little idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
    – goldenbutter
    Aug 31 at 11:46















thanks for help.....both of your answer is correct. i was new for loop, so have little idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
– goldenbutter
Aug 31 at 11:46




thanks for help.....both of your answer is correct. i was new for loop, so have little idea but no proper syntax knowledge ... thanks for helping..... just need to know if i can print the file name in console which one is missing in that loop while check the names..... i have 3 files so which one is missing i need to print there... thanks in advance
– goldenbutter
Aug 31 at 11:46

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f465968%2fhow-to-wait-for-all-files-and-copy-into-dir%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay