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!
linux bash script shell-script bash-scripting
New contributor
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.
add a comment |
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!
linux bash script shell-script bash-scripting
New contributor
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 withfind -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
add a comment |
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!
linux bash script shell-script bash-scripting
New contributor
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
linux bash script shell-script bash-scripting
New contributor
New contributor
New contributor
asked Nov 17 at 10:29
Meet Vora
1
1
New contributor
New contributor
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 withfind -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
add a comment |
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 withfind -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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 withfind -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