1

I have result after grep truststore.jks

Command for grep

keytool -list -v -keystore ./truststore.jks -storepass **** | grep "until"

Result

Valid from: Mon Jun 04 13:17:22 MSK 2018 until: Fri Jun 04 13:27:21 MSK 2038
Valid from: Mon Jun 04 16:17:00 MSK 2018 until: Sun Jun 04 16:27:00 MSK 2023
Valid from: Mon Mar 07 12:35:36 MSK 2022 until: Sun Mar 07 12:45:36 MSK 2027

Then i need to get only date after "until:" but in format like 'dd-mm-yyyy HH:MM:SS'

Result must be

04-06-2038 13:27:21
04-06-2023 16:27:00
07-03-2027 12:45:36

I do it for task, which can monitoring when certificates will be end

BoLjshOJ
  • 11
  • 3
  • Please add to your question (no comment): What have you searched for, and what did you find? What have you tried, and how did it fail? – Cyrus Nov 14 '22 at 22:28
  • See: [Formatting date strings in a file with linux bash shell](https://stackoverflow.com/q/61015078/3776858) – Cyrus Nov 14 '22 at 22:31
  • @Cyrus thank you for hint about formatting date strings Maybe you can help with parse string "Valid from: Mon Jun 04 13:17:22 MSK 2018 until: Fri Jun 04 13:27:21 MSK 2038" to "Fri Jun 04 13:27:21 MSK 2038" – BoLjshOJ Nov 15 '22 at 08:18

0 Answers0