Last active
August 31, 2021 15:55
-
-
Save craigforr/d2c6fbee1e5c2a6f8bf82ea00cdaac96 to your computer and use it in GitHub Desktop.
Revisions
-
craigforr revised this gist
Aug 31, 2021 . 1 changed file with 16 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,17 +4,23 @@ # Source: python - command-line world clock? - Stack Overflow # https://stackoverflow.com/questions/370075/command-line-world-clock function world_date(){ if [ "$1"x != 'x' ]; then search=$1 else echo "Please provide a time zone." fi zoneinfo=/usr/share/zoneinfo/posix/ format='%a %F %T' find -L $zoneinfo -type f \ | grep -i "$search" \ | while read z; do d=$(TZ=$z date +"$format") printf "%-34s %23s\n" ${z#$zoneinfo} "$d" done } world_date $1 # EOF -
craigforr revised this gist
Aug 31, 2021 . No changes.There are no files selected for viewing
-
craigforr revised this gist
Aug 31, 2021 . No changes.There are no files selected for viewing
-
craigforr created this gist
Mar 10, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #!/bin/sh # Show date and time in other time zones # Source: python - command-line world clock? - Stack Overflow # https://stackoverflow.com/questions/370075/command-line-world-clock search=$1 zoneinfo=/usr/share/zoneinfo/posix/ format='%a %F %T' find -L $zoneinfo -type f \ | grep -i "$search" \ | while read z do d=$(TZ=$z date +"$format") printf "%-34s %23s\n" ${z#$zoneinfo} "$d" done # EOF