| 1 | #!/bin/bash |
| 2 | # recursion-def.sh |
| 3 | # A script that defines "recursion" in a rather graphic way. |
| 4 | |
| 5 | RECURSIONS=10 |
| 6 | r_count=0 |
| 7 | sp=" " |
| 8 | |
| 9 | define_recursion () |
| 10 | { |
| 11 | ((r_count++)) |
| 12 | sp="$sp"" " |
| 13 | echo -n "$sp" |
| 14 | echo "\"The act of recurring ... \"" # Per 1913 Webster's dictionary. |
| 15 | |
| 16 | while [ $r_count -le $RECURSIONS ] |
| 17 | do |
| 18 | define_recursion |
| 19 | done |
| 20 | } |
| 21 | |
| 22 | echo |
| 23 | echo "Recursion: " |
| 24 | define_recursion |
| 25 | echo |
| 26 | |
| 27 | exit $? |