Pick out a date from a command response
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a command response that looks something like that:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX | XXX | Thu Oct 18 03:32:00 UTC 2018
XXX | XXX | Thu Oct 18 03:32:00 UTC 2018
There are a lot of tab spaces between each set of characters and pipe.
The aim is to pick out the date from the response and then compare it with the current time, find the difference and make sure it's not more than 300 seconds. This is my first time making a shell script and I am not sure how this could work.
I have tried using grep to get the entire line. Is there a way to neglect the spaces in between the characters? How do I convert that format of a date to the regular date format?
Thank you!
shell-script shell hp-ux
New contributor
Aman Deep Middha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
I have a command response that looks something like that:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX | XXX | Thu Oct 18 03:32:00 UTC 2018
XXX | XXX | Thu Oct 18 03:32:00 UTC 2018
There are a lot of tab spaces between each set of characters and pipe.
The aim is to pick out the date from the response and then compare it with the current time, find the difference and make sure it's not more than 300 seconds. This is my first time making a shell script and I am not sure how this could work.
I have tried using grep to get the entire line. Is there a way to neglect the spaces in between the characters? How do I convert that format of a date to the regular date format?
Thank you!
shell-script shell hp-ux
New contributor
Aman Deep Middha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
are date/time are always the same? meaning you have two lines have date/time are these always the same? pelasee clarify?
â Goro
54 secs ago
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a command response that looks something like that:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX | XXX | Thu Oct 18 03:32:00 UTC 2018
XXX | XXX | Thu Oct 18 03:32:00 UTC 2018
There are a lot of tab spaces between each set of characters and pipe.
The aim is to pick out the date from the response and then compare it with the current time, find the difference and make sure it's not more than 300 seconds. This is my first time making a shell script and I am not sure how this could work.
I have tried using grep to get the entire line. Is there a way to neglect the spaces in between the characters? How do I convert that format of a date to the regular date format?
Thank you!
shell-script shell hp-ux
New contributor
Aman Deep Middha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I have a command response that looks something like that:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX | XXX | Thu Oct 18 03:32:00 UTC 2018
XXX | XXX | Thu Oct 18 03:32:00 UTC 2018
There are a lot of tab spaces between each set of characters and pipe.
The aim is to pick out the date from the response and then compare it with the current time, find the difference and make sure it's not more than 300 seconds. This is my first time making a shell script and I am not sure how this could work.
I have tried using grep to get the entire line. Is there a way to neglect the spaces in between the characters? How do I convert that format of a date to the regular date format?
Thank you!
shell-script shell hp-ux
shell-script shell hp-ux
New contributor
Aman Deep Middha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Aman Deep Middha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Aman Deep Middha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 6 mins ago
Aman Deep Middha
1
1
New contributor
Aman Deep Middha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Aman Deep Middha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Aman Deep Middha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
are date/time are always the same? meaning you have two lines have date/time are these always the same? pelasee clarify?
â Goro
54 secs ago
add a comment |Â
are date/time are always the same? meaning you have two lines have date/time are these always the same? pelasee clarify?
â Goro
54 secs ago
are date/time are always the same? meaning you have two lines have date/time are these always the same? pelasee clarify?
â Goro
54 secs ago
are date/time are always the same? meaning you have two lines have date/time are these always the same? pelasee clarify?
â Goro
54 secs ago
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Aman Deep Middha is a new contributor. Be nice, and check out our Code of Conduct.
Aman Deep Middha is a new contributor. Be nice, and check out our Code of Conduct.
Aman Deep Middha is a new contributor. Be nice, and check out our Code of Conduct.
Aman Deep Middha is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476449%2fpick-out-a-date-from-a-command-response%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
are date/time are always the same? meaning you have two lines have date/time are these always the same? pelasee clarify?
â Goro
54 secs ago