How to wait for all files and copy into dir
Clash 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
shell-script shell
add a comment |Â
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
shell-script shell
If you know all three filenames, then just test for existence of those three filenames.
â Kusalananda
Aug 31 at 9:21
you could trysleep 60 && sh basename "$0"
` instead ofecho "file missing"
â msp9011
Aug 31 at 9:26
add a comment |Â
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
shell-script shell
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
shell-script shell
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 trysleep 60 && sh basename "$0"
` instead ofecho "file missing"
â msp9011
Aug 31 at 9:26
add a comment |Â
If you know all three filenames, then just test for existence of those three filenames.
â Kusalananda
Aug 31 at 9:21
you could trysleep 60 && sh basename "$0"
` instead ofecho "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
add a comment |Â
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
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
add a comment |Â
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
bygrep -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
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
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
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
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
add a comment |Â
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
add a comment |Â
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
bygrep -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
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
add a comment |Â
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
bygrep -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
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
add a comment |Â
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
bygrep -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
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
bygrep -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
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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 ofecho "file missing"
â msp9011
Aug 31 at 9:26