Skip to main content
Home
badllama.com
  • Search
  • Log In

Obscure One-Liners

Thu, 04/07/2011 - 00:12 by bchavet

Five days before the first Saturday following the second Tuesday of the month

test "`date +%a`" == "Mon" -a `date +%e | awk '{print (($1 + 1) / 7 > 1 && ($1 + 1) / 7 <= 2)}'` -eq 1

First Saturday following the second Tuesday of the month

test "`date +%a`" == "Sat" -a `date +%e | awk '{print (($1 - 4) / 7 > 1 && ($1 - 4) / 7 <= 2)}'` -eq 1

Five days before the first Tuesday following the second Tuesday of the month

test "`date +%a`" == "Thu" -a `date +%e | awk '{print (($1 - 2) / 7 > 1 && ($1 - 2) / 7 <= 2)}'` -eq 1

First Tuesday following the second Tuesday of the month

test "`date +%a`" == "Tue" -a `date +%e | awk '{print (($1 - 7) / 7 > 1 && ($1 - 7) / 7 <= 2)}'` -eq 1

Five days before the second Thursday following the second Tuesday of the month

test "`date +%a`" == "Sat" -a `date +%e | awk '{print (($1 - 4) / 7 > 1 && ($1 - 4) / 7 <= 2)}'` -eq 1

Second Thursday following the second Tuesday of the month

test "`date +%a`" == "Thu" -a `date +%e | awk '{print (($1 - 9) / 7 > 1 && ($1 - 9) / 7 <= 2)}'` -eq 1

Five days before the second Saturday following the second Tuesday of the month

test "`date +%a`" == "Mon" -a `date +%e | awk '{print (($1 - 6) / 7 > 1 && ($1 - 6) / 7 <= 2)}'` -eq 1

Second Saturday following the second Tuesday of the month

test "`date +%a`" == "Sat" -a `date +%e | awk '{print (($1 - 11) / 7 > 1 && ($1 - 11) / 7 <= 2)}'` -eq 1
Powered by Backdrop CMS