Skip to content

Instantly share code, notes, and snippets.

@daniel-fanjul-alcuten
Created July 18, 2013 11:17
Show Gist options
  • Save daniel-fanjul-alcuten/6028534 to your computer and use it in GitHub Desktop.
Save daniel-fanjul-alcuten/6028534 to your computer and use it in GitHub Desktop.
factorial in bash
function factorial() { { echo 0; seq $1 | sed s/$/*/; echo p; } | dc; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment