Remove all scheduled before 17:00 jobs with atrm [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash 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






share|improve this 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














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






share|improve this 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












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






share|improve this question













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








share|improve this question












share|improve this question




share|improve this question








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
















  • @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










1 Answer
1






active

oldest

votes

















up vote
1
down vote













  1. You're using the wrong quoting around the date command. You're using "curly" single quotes (‘...’) instead of backticks (`...`), but use $(...) instead of backticks.

  2. You're not allowed spaces around the = for a variable assignment

  3. 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.






share|improve this answer























  • 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

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













  1. You're using the wrong quoting around the date command. You're using "curly" single quotes (‘...’) instead of backticks (`...`), but use $(...) instead of backticks.

  2. You're not allowed spaces around the = for a variable assignment

  3. 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.






share|improve this answer























  • 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














up vote
1
down vote













  1. You're using the wrong quoting around the date command. You're using "curly" single quotes (‘...’) instead of backticks (`...`), but use $(...) instead of backticks.

  2. You're not allowed spaces around the = for a variable assignment

  3. 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.






share|improve this answer























  • 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












up vote
1
down vote










up vote
1
down vote









  1. You're using the wrong quoting around the date command. You're using "curly" single quotes (‘...’) instead of backticks (`...`), but use $(...) instead of backticks.

  2. You're not allowed spaces around the = for a variable assignment

  3. 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.






share|improve this answer















  1. You're using the wrong quoting around the date command. You're using "curly" single quotes (‘...’) instead of backticks (`...`), but use $(...) instead of backticks.

  2. You're not allowed spaces around the = for a variable assignment

  3. 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.







share|improve this answer















share|improve this answer



share|improve this answer








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
















  • 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


Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay