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











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.











closed as too broad by DavidPostill Nov 17 at 18:06


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
    Nov 17 at 11:09










  • 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
    Nov 17 at 18:06















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.











closed as too broad by DavidPostill Nov 17 at 18:06


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
    Nov 17 at 11:09










  • 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
    Nov 17 at 18:06













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 Nov 17 at 10:29









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.




closed as too broad by DavidPostill Nov 17 at 18:06


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.






closed as too broad by DavidPostill Nov 17 at 18:06


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
    Nov 17 at 11:09










  • 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
    Nov 17 at 18:06


















  • 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
    Nov 17 at 11:09










  • 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
    Nov 17 at 18:06
















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
Nov 17 at 11:09




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
Nov 17 at 11:09












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
Nov 17 at 18:06




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
Nov 17 at 18:06















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

AnyDesk - Fatal Program Failure

How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

QoS: MAC-Priority for clients behind a repeater