perl -e "$t=shift;while($t<=$ARGV[0]){print gmtime($t)=~/(.*\w 1)/?$1.$/:'';$t+=86400}" # or perl -e "$t=shift;while($t<=$ARGV[0]){print gmtime($t)=~/(.* 1)/?$1.$/:'';$t+=86400}" # or perl -le "$t=shift;while($t<=$ARGV[0]){gmtime($t)=~/(.* 1)/?print$1:0;$t+=86400}" 1580500427 1591220427 Sat Feb 1 Sun Mar 1 Wed Apr 1 Fri May 1 Mon Jun 1