#!/bin/bash

uso()
{
  echo "La sintaxis del script es: circulo [r | d] numero" 
  exit 1
}

if test $# -lt 2
  then uso
fi

# Se calcula pi utilizando que tangente(pi/4) = 1
PI=$(echo "4 * a(1)" | bc -l)

case $1 in
  r) AR=$(echo "$PI * $2^2" | bc) ;;
  d) AR=$(echo "$PI * ($2/2) ^2" | bc) ;;
  *) uso ;;
esac

echo $AR

exit 0