fork(7) download
  1. #!/bin/bash
  2. s='Local time: Wed 2022-11-16 13:02:00 CET
  3. Universal time: Wed 2022-11-16 12:02:00 UTC
  4. RTC time: Wed 2022-11-16 12:02:01
  5. Time zone: Europe/Rome (CET, +0100)
  6. System clock synchronized: yes
  7. NTP service: inactive
  8. RTC in local TZ: no'
  9. sed -n 's/^ *Time zone: \([^ ]*\).*/\1/p' <<< "$s"
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
Europe/Rome