mettastar Posted October 25, 2016 Report Posted October 25, 2016 I need to wait for a n number of files to appear before coming out of the loop. filename will be wildcard files unnayo levo teluskodaniki i figured it out.. but naku certain number of files untene proceed avvadam elano teliyatle.. my current logic while [ ! -f #Path#/Temp/Trigger_#Tag#_* ]; do sleep 2 ; done ; echo 0 but naku files equal to certain number untene povali ante etlaa.. Quote
sri_india Posted October 25, 2016 Report Posted October 25, 2016 30 minutes ago, mettastar said: I need to wait for a n number of files to appear before coming out of the loop. filename will be wildcard files unnayo levo teluskodaniki i figured it out.. but naku certain number of files untene proceed avvadam elano teliyatle.. my current logic while [ ! -f #Path#/Temp/Trigger_#Tag#_* ]; do sleep 2 ; done ; echo 0 but naku files equal to certain number untene povali ante etlaa.. @yomama ki message cheyi bro ..... he may help you Quote
Tesla Posted October 25, 2016 Report Posted October 25, 2016 Probably not a sophisticated way but this will do what you are looking for #!/bin/ksh matcond=1 descount=10 ##assuming you need 10 files while [ $matcond == 1 ] do ls -ltr *touch* > tempfile count=$(wc -l < tempfile) echo $count if [ $count -eq $descount ] then matcond=2 else sleep 2 fi done Quote
dkchinnari Posted October 25, 2016 Report Posted October 25, 2016 Umcle nee unix lolli endhi..nu datastage ghaa Quote
mettastar Posted October 25, 2016 Author Report Posted October 25, 2016 got it while [ ! -f /Temp/Trigger_* ] || [ -f /Temp/Trigger_* ] && [ "$( ls /Temp/Trigger_* 2> /dev/null | wc -l)" -le "2" ]; do echo sleeping ;sleep 2 ; done ; echo 0 evarikain use aithadi Quote
sri_india Posted October 25, 2016 Report Posted October 25, 2016 1 minute ago, mettastar said: got it while [ ! -f /Temp/Trigger_* ] || [ -f /Temp/Trigger_* ] && [ "$( ls /Temp/Trigger_* 2> /dev/null | wc -l)" -le "2" ]; do echo sleeping ;sleep 2 ; done ; echo 0 evarikain use aithadi Quote
mettastar Posted October 25, 2016 Author Report Posted October 25, 2016 6 minutes ago, dkchinnari said: Umcle nee unix lolli endhi..nu datastage ghaa DS lo using vuncle Quote
yomama Posted October 25, 2016 Report Posted October 25, 2016 uncle db lo notifications ravu, but someone already answered u query i guess Quote
sri_india Posted October 25, 2016 Report Posted October 25, 2016 52 minutes ago, yomama said: uncle db lo notifications ravu, but someone already answered u query i guess inka easy solution emina undhaa bro deeniki .... Quote
mettastar Posted October 26, 2016 Author Report Posted October 26, 2016 3 hours ago, Tesla said: Probably not a sophisticated way but this will do what you are looking for #!/bin/ksh matcond=1 descount=10 ##assuming you need 10 files while [ $matcond == 1 ] do ls -ltr *touch* > tempfile count=$(wc -l < tempfile) echo $count if [ $count -eq $descount ] then matcond=2 else sleep 2 fi done Dont want to write a script bro.. inline lo chedham ani. i got it. thanks though Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.