Remove all scheduled before 17:00 jobs with atrm [closed]
Clash Royale CLAN TAG#URR8PPP
up vote
-3
down vote
favorite
I need a shell script that removes all scheduled before 17:00 jobs with the user name as a positional parameter
This is what I tried to do
#!/bin/bash
currentTime = âÂÂdate + %k%MâÂÂ
check_time_tu_run()
tempTime=$1
if
[ $tempTime -gt 000 -a $tempTime -lt 1700];
then
for i in `atq
check_time_to_run $currentTime
shell-script at jobs
closed as too broad by dr01, G-Man, Jeff Schaller, Isaac, Rui F Ribeiro May 30 at 3:39
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
-3
down vote
favorite
I need a shell script that removes all scheduled before 17:00 jobs with the user name as a positional parameter
This is what I tried to do
#!/bin/bash
currentTime = âÂÂdate + %k%MâÂÂ
check_time_tu_run()
tempTime=$1
if
[ $tempTime -gt 000 -a $tempTime -lt 1700];
then
for i in `atq
check_time_to_run $currentTime
shell-script at jobs
closed as too broad by dr01, G-Man, Jeff Schaller, Isaac, Rui F Ribeiro May 30 at 3:39
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.
@StephenKitt I edited it
â Ovidiu Stancu
May 29 at 14:26
Besides the smart quotes, what happened when you tried to use it? (sample input & output)
â Jeff Schaller
May 29 at 15:29
add a comment |Â
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
I need a shell script that removes all scheduled before 17:00 jobs with the user name as a positional parameter
This is what I tried to do
#!/bin/bash
currentTime = âÂÂdate + %k%MâÂÂ
check_time_tu_run()
tempTime=$1
if
[ $tempTime -gt 000 -a $tempTime -lt 1700];
then
for i in `atq
check_time_to_run $currentTime
shell-script at jobs
I need a shell script that removes all scheduled before 17:00 jobs with the user name as a positional parameter
This is what I tried to do
#!/bin/bash
currentTime = âÂÂdate + %k%MâÂÂ
check_time_tu_run()
tempTime=$1
if
[ $tempTime -gt 000 -a $tempTime -lt 1700];
then
for i in `atq
check_time_to_run $currentTime
shell-script at jobs
edited May 29 at 14:28
glenn jackman
45.7k265100
45.7k265100
asked May 29 at 9:45
Ovidiu Stancu
61
61
closed as too broad by dr01, G-Man, Jeff Schaller, Isaac, Rui F Ribeiro May 30 at 3:39
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 dr01, G-Man, Jeff Schaller, Isaac, Rui F Ribeiro May 30 at 3:39
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.
@StephenKitt I edited it
â Ovidiu Stancu
May 29 at 14:26
Besides the smart quotes, what happened when you tried to use it? (sample input & output)
â Jeff Schaller
May 29 at 15:29
add a comment |Â
@StephenKitt I edited it
â Ovidiu Stancu
May 29 at 14:26
Besides the smart quotes, what happened when you tried to use it? (sample input & output)
â Jeff Schaller
May 29 at 15:29
@StephenKitt I edited it
â Ovidiu Stancu
May 29 at 14:26
@StephenKitt I edited it
â Ovidiu Stancu
May 29 at 14:26
Besides the smart quotes, what happened when you tried to use it? (sample input & output)
â Jeff Schaller
May 29 at 15:29
Besides the smart quotes, what happened when you tried to use it? (sample input & output)
â Jeff Schaller
May 29 at 15:29
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
- You're using the wrong quoting around the date command. You're using "curly" single quotes (
âÂÂ...âÂÂ
) instead of backticks (`...`
), but use$(...)
instead of backticks. - You're not allowed spaces around the
=
for a variable assignment - The
+
must not be followed by a space.
Use: currentTime=$( date +%k%M )
Also the name of the function you define (check_time_tu_run
)
is not the name of the function you call (check_time_to_run
)
There are other errors: paste your code into https://www.shellcheck.net for more assistance.
Any way you could help me make it work?
â Ovidiu Stancu
May 29 at 14:52
Of course: follow the advice I've already written.
â glenn jackman
May 29 at 15:06
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
- You're using the wrong quoting around the date command. You're using "curly" single quotes (
âÂÂ...âÂÂ
) instead of backticks (`...`
), but use$(...)
instead of backticks. - You're not allowed spaces around the
=
for a variable assignment - The
+
must not be followed by a space.
Use: currentTime=$( date +%k%M )
Also the name of the function you define (check_time_tu_run
)
is not the name of the function you call (check_time_to_run
)
There are other errors: paste your code into https://www.shellcheck.net for more assistance.
Any way you could help me make it work?
â Ovidiu Stancu
May 29 at 14:52
Of course: follow the advice I've already written.
â glenn jackman
May 29 at 15:06
add a comment |Â
up vote
1
down vote
- You're using the wrong quoting around the date command. You're using "curly" single quotes (
âÂÂ...âÂÂ
) instead of backticks (`...`
), but use$(...)
instead of backticks. - You're not allowed spaces around the
=
for a variable assignment - The
+
must not be followed by a space.
Use: currentTime=$( date +%k%M )
Also the name of the function you define (check_time_tu_run
)
is not the name of the function you call (check_time_to_run
)
There are other errors: paste your code into https://www.shellcheck.net for more assistance.
Any way you could help me make it work?
â Ovidiu Stancu
May 29 at 14:52
Of course: follow the advice I've already written.
â glenn jackman
May 29 at 15:06
add a comment |Â
up vote
1
down vote
up vote
1
down vote
- You're using the wrong quoting around the date command. You're using "curly" single quotes (
âÂÂ...âÂÂ
) instead of backticks (`...`
), but use$(...)
instead of backticks. - You're not allowed spaces around the
=
for a variable assignment - The
+
must not be followed by a space.
Use: currentTime=$( date +%k%M )
Also the name of the function you define (check_time_tu_run
)
is not the name of the function you call (check_time_to_run
)
There are other errors: paste your code into https://www.shellcheck.net for more assistance.
- You're using the wrong quoting around the date command. You're using "curly" single quotes (
âÂÂ...âÂÂ
) instead of backticks (`...`
), but use$(...)
instead of backticks. - You're not allowed spaces around the
=
for a variable assignment - The
+
must not be followed by a space.
Use: currentTime=$( date +%k%M )
Also the name of the function you define (check_time_tu_run
)
is not the name of the function you call (check_time_to_run
)
There are other errors: paste your code into https://www.shellcheck.net for more assistance.
edited May 29 at 14:36
answered May 29 at 14:31
glenn jackman
45.7k265100
45.7k265100
Any way you could help me make it work?
â Ovidiu Stancu
May 29 at 14:52
Of course: follow the advice I've already written.
â glenn jackman
May 29 at 15:06
add a comment |Â
Any way you could help me make it work?
â Ovidiu Stancu
May 29 at 14:52
Of course: follow the advice I've already written.
â glenn jackman
May 29 at 15:06
Any way you could help me make it work?
â Ovidiu Stancu
May 29 at 14:52
Any way you could help me make it work?
â Ovidiu Stancu
May 29 at 14:52
Of course: follow the advice I've already written.
â glenn jackman
May 29 at 15:06
Of course: follow the advice I've already written.
â glenn jackman
May 29 at 15:06
add a comment |Â
@StephenKitt I edited it
â Ovidiu Stancu
May 29 at 14:26
Besides the smart quotes, what happened when you tried to use it? (sample input & output)
â Jeff Schaller
May 29 at 15:29