LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Check data and run script (https://www.linuxquestions.org/questions/linux-newbie-8/check-data-and-run-script-4175435167/)

ust 11-01-2012 08:45 PM

Check data and run script
 
I would like to write a script to do such thing , if a directory have file that the extension is today (yymmdd), then do a specific action , I will run a cron job to run this script .

for example

oday is 2nd , if the directory have files which file name are abc.121102 and def.121102 , then echo the file name , so the output is abc , def


tomorrow is 3rd , if the directory have files which the file name are xxx.121103 and yyy.121103 , then echo the file name , so the output is xxx , yyy

can advise how to it ?

thanks.

unSpawn 11-01-2012 09:15 PM

Quote:

Originally Posted by ust (Post 4820111)
write a script

In the approximately nine years you've been with us you've posted over 600 threads and often about scripting. By now you should put in some effort and make it a habit to post what you have come up with without being asked.
TIA

TB0ne 11-02-2012 01:09 PM

Quote:

Originally Posted by ust (Post 4820111)
I would like to write a script to do such thing , if a directory have file that the extension is today (yymmdd), then do a specific action , I will run a cron job to run this script .

for example today is 2nd , if the directory have files which file name are abc.121102 and def.121102 , then echo the file name , so the output is abc , def
tomorrow is 3rd , if the directory have files which the file name are xxx.121103 and yyy.121103 , then echo the file name , so the output is xxx , yyy

can advise how to it ?

Yes...read the advice given to you over the past NINE YEARS, and try to actually APPLY THAT KNOWLEDGE AND LEARN SOMETHING
http://www.linuxquestions.org/questi...lp-4175432449/
https://www.linuxquestions.org/quest...er-4175413626/
https://www.linuxquestions.org/quest...te-4175413358/
https://www.linuxquestions.org/quest...column-944377/
https://www.linuxquestions.org/quest...script-946113/

You've been pointed to shell scripting tutorials many, MANY times...you need to actually READ one.


All times are GMT -5. The time now is 11:34 PM.