This file contains 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 characters
seq -w 00 99 | sed -e "1,$(echo "scale=2;" \(\($(date +%s) - $(date -d $(date +%Y)-01-01 +%s)\) / 86400\) / 365 | bc | sed -e 's/^\.//g')s/.*/ /g" -e 's/ /■/g' -e 's/ //g' -e 's/[0-9][0-9]/□/g' | tr '\n' ' ' | sed -e 's/ //g';echo -n ' ';echo "scale=2;" \(\($(date +%s) - $(date -d $(date +%Y)-01-01 +%s)\) / 86400\) / 365 | bc | sed -e 's/^\.//g' -e 's/$/%/g' |
実行するとこんな感じになる。
■■■■■■■■■■■■■■■■■■■■■□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ 21%
追記(とある方より)
This file contains 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 characters
$ date +%j | awk '{len=int($1/3.65);for(i=0;i<len;i++)printf "%c", "X";printf"\n%d%%",len}' |
This file contains 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 characters
seq 0 99 | sed -e 's/.*/□/g' -e "1,$(echo $(date +%j)/3.65 | bc)s/.*/■/g" | tr '\n' ' ' | tr -d ' ';echo $(date +%j)/3.65 | bc | sed -e 's/^/ /g' -e 's/$/%/g' |
% seq 0 99 | sed -e 's/.*/_/g' -e "1,$(echo $(date +%j)/3.65 | bc)s/.*/X/g" | tr '\n' ' ' | tr -d ' ' | fold -w 10
XXXXXXXXXX XXXXXXXXXX X_________ __________ __________ __________ __________ __________ __________ __________