PI Day

Today is pi day, hence the mandatory bash script. It requires gnu bc, and figlet to run.

#!/bin/bash
# happy pi day

function pi(){
  { echo -n "scale=50;"; seq 1 2 100 | xargs -n1 -I{} echo '(16*(1/5)^{}/{}-4*(1/239)^{}/{})';} | paste -sd-+ | bc -l
}

figlet Happy Pi Day $(pi)
This post is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License