Bash Recursive Function