I have this type of bash script to execute a function recursively in the subdirectories (the real one is more useful than the one in the example below
):
Code:
#!/bin/sh
hereiam ()
{
echo "Here I am now:" $(pwd)
}
find . -type d | while read dir; do hereiam; done
I am finding some problems with the function but I don't know if it is due to the function itself or by the way that find | while ( or find | xargs for that sake) operate.
How can I execute the function recursively without 'find'?
Thanks!
Osio