citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

devpeople (562B)


      1 #!/usr/bin/env bash
      2 
      3 peeps=$(cat <<EOP
      4 Australia/Adelaide,rusty
      5 Europe/Malta,adamback
      6 Europe/Zurich,cdecker
      7 Europe/Rome,lawrence
      8 Europe/Rome,alekos,10:00,18:00
      9 EOP
     10 )
     11 
     12 (printf "name	time	start	end	pt_start	pt_end\n";
     13 while IFS=, read -r tz person start end
     14 do
     15   d=$(TZ="$tz" date +'%a %F  %R')
     16   start_local=""
     17   end_local=""
     18   if [[ -n $start ]]; then
     19     start_local=$(date --date 'TZ="'$tz'" '$start +%R)
     20     end_local=$(date --date 'TZ="'$tz'" '$end +%R)
     21   fi
     22   printf "$person	$d	$start	$end	$start_local	$end_local\n"
     23 done <<<"$peeps") | column -t -s $'\t'