Scripting help: Execute different commands according to “touch” state [on hold]











up vote
-1
down vote

favorite












I want to make a script which checks if a file was touched $today -if yes, it does something, if not, it does something else.



What's the best way to do this?



Appreciate any help!










share|improve this question







New contributor




Meet Vora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as too broad by DavidPostill 2 days ago


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • Welcome to Super User. Is $today always the day the script runs? or is it a variable that may contain any date? (in what format then?). "The best way" meaning: portable? shortest? fastest? most robust? what? What have you tried so far? Something with find -mtime? stat? date? test? if? Please note Super User is not a script writing service, questions should show some research effort (the tools I mentioned are a good start). You can post your current piece of code, tell us what doesn't work and where you are stuck; then we help. Respond to this comment by editing the question.
    – Kamil Maciorowski
    2 days ago










  • Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
    – DavidPostill
    2 days ago















up vote
-1
down vote

favorite












I want to make a script which checks if a file was touched $today -if yes, it does something, if not, it does something else.



What's the best way to do this?



Appreciate any help!










share|improve this question







New contributor




Meet Vora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as too broad by DavidPostill 2 days ago


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • Welcome to Super User. Is $today always the day the script runs? or is it a variable that may contain any date? (in what format then?). "The best way" meaning: portable? shortest? fastest? most robust? what? What have you tried so far? Something with find -mtime? stat? date? test? if? Please note Super User is not a script writing service, questions should show some research effort (the tools I mentioned are a good start). You can post your current piece of code, tell us what doesn't work and where you are stuck; then we help. Respond to this comment by editing the question.
    – Kamil Maciorowski
    2 days ago










  • Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
    – DavidPostill
    2 days ago













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I want to make a script which checks if a file was touched $today -if yes, it does something, if not, it does something else.



What's the best way to do this?



Appreciate any help!










share|improve this question







New contributor




Meet Vora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I want to make a script which checks if a file was touched $today -if yes, it does something, if not, it does something else.



What's the best way to do this?



Appreciate any help!







linux bash script shell-script bash-scripting






share|improve this question







New contributor




Meet Vora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Meet Vora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Meet Vora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









Meet Vora

1




1




New contributor




Meet Vora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Meet Vora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Meet Vora is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as too broad by DavidPostill 2 days ago


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as too broad by DavidPostill 2 days ago


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Welcome to Super User. Is $today always the day the script runs? or is it a variable that may contain any date? (in what format then?). "The best way" meaning: portable? shortest? fastest? most robust? what? What have you tried so far? Something with find -mtime? stat? date? test? if? Please note Super User is not a script writing service, questions should show some research effort (the tools I mentioned are a good start). You can post your current piece of code, tell us what doesn't work and where you are stuck; then we help. Respond to this comment by editing the question.
    – Kamil Maciorowski
    2 days ago










  • Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
    – DavidPostill
    2 days ago


















  • Welcome to Super User. Is $today always the day the script runs? or is it a variable that may contain any date? (in what format then?). "The best way" meaning: portable? shortest? fastest? most robust? what? What have you tried so far? Something with find -mtime? stat? date? test? if? Please note Super User is not a script writing service, questions should show some research effort (the tools I mentioned are a good start). You can post your current piece of code, tell us what doesn't work and where you are stuck; then we help. Respond to this comment by editing the question.
    – Kamil Maciorowski
    2 days ago










  • Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
    – DavidPostill
    2 days ago
















Welcome to Super User. Is $today always the day the script runs? or is it a variable that may contain any date? (in what format then?). "The best way" meaning: portable? shortest? fastest? most robust? what? What have you tried so far? Something with find -mtime? stat? date? test? if? Please note Super User is not a script writing service, questions should show some research effort (the tools I mentioned are a good start). You can post your current piece of code, tell us what doesn't work and where you are stuck; then we help. Respond to this comment by editing the question.
– Kamil Maciorowski
2 days ago




Welcome to Super User. Is $today always the day the script runs? or is it a variable that may contain any date? (in what format then?). "The best way" meaning: portable? shortest? fastest? most robust? what? What have you tried so far? Something with find -mtime? stat? date? test? if? Please note Super User is not a script writing service, questions should show some research effort (the tools I mentioned are a good start). You can post your current piece of code, tell us what doesn't work and where you are stuck; then we help. Respond to this comment by editing the question.
– Kamil Maciorowski
2 days ago












Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
– DavidPostill
2 days ago




Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
– DavidPostill
2 days ago















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Paul Cézanne

UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

Angular material date-picker (MatDatepicker) auto completes the date on focus out