3 ms·
cal -y | sed -E '1,2d;s/(.{20}) /\1\n/g;' | egrep “^. .* $“ or cal -y | sed -E '1,2d;s/(.{20}) /\1\n/g;' | python3 -c “from calendar import month_name;i
by helsinki 5y ago
cal -y | sed -E '1,2d;s/(.{20}) /\1\n/g;' | egrep “^. .* $“
or
cal -y | sed -E '1,2d;s/(.{20}) /\1\n/g;' | python3 -c “from calendar import month_name;import sys;[print(ln.strip()) for ln in sys.stdin.readlines() if ln.strip() in month_name]”
- rak1507 5y agoNeither of them seem to work for me - what am I missing? https://tio.run/##lcxBDoIwFIThvaeYNCYUI0VwydpTiJpKCzSB16bthqhnR0hMWLv98808ZejnuZEDsglvBK2QXZAUx1JVIefiVZ4@KfK6qCnvqmQhuvPagd0FxAF7tvtn66bYWzoja8Bab0csY01KepjRWR8xWor9g@Soq18JU6iuzhuKfCARojeOpyla6zEQDK1gycqQ8FqqwZAOPIVpsfGVbc83Ns9f https://tio.run/##lcxBDoIwFIThvaeYNCYUI0VwydpTiJpKCzSB16bthq...
- helsinki 5y agoSorry about that. I was typing from my phone, blindly. This is a cool website, thanks. Here is the correct solution: cal -y | sed -E '1,2d;s/(.{20}) /\1\n/g;' | python3 -c "from calendar import month_name;import sys;[print(ln.strip()) for ln in sys.stdin.readlines() if ln.strip() in month_name and len(ln.strip())]" https://tio.run/##TY1BDsIgFAWv8tJNIbGtrUvWnsIag4VaEvohwKZRz440MdHtZN68u4xLzpO0aDa8ELVCc0bdHwYlYsfa53B8c3RjP1L3EHVR/JYWRyc0E6o5uBVlrEnJALN6FxJWR2m5kVy1@JK4RXHxwVBiltqYgvGMc8wuwBIM7ULBylAbtFTWkI6Mw8z46bv2K0OSQrn9712rnD8 https://tio.run/##TY1BDsIgFAWv8tJNIbGtrUvWnsIag4VaEvohwKZRz4...
- t0mas88 5y agoThat's only a list of names of months, the article creates a single column view with all the dates be between to then count the number of weeks between two dates.