aboutsummaryrefslogtreecommitdiffstats
path: root/examples/functions/recurse
diff options
context:
space:
mode:
Diffstat (limited to 'examples/functions/recurse')
-rw-r--r--examples/functions/recurse7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/functions/recurse b/examples/functions/recurse
index 14c4b9e..f69cd50 100644
--- a/examples/functions/recurse
+++ b/examples/functions/recurse
@@ -44,15 +44,15 @@ function recurse
if cd "$1" ; then
for file in $2; do
- if [ -f "$file" -o -d "$file" ]; then
+ if [ -f "$file" ] || [ -d "$file" ]; then
eval "$3"
fi
done
for file in .* * ; do
- if [ "$file" = "." -o "$file" = ".." ] ; then
+ if [ "$file" = "." ] || [ "$file" = ".." ] ; then
continue
fi
- if [ -d "$file" -a ! -L "$file" ]; then
+ if [ -d "$file" ] && [ ! -L "$file" ]; then
recurse "$file" "$2" "$3" "$path"
fi
done
@@ -61,4 +61,3 @@ function recurse
}
recurse "$1" "$2" 'echo "$path$file"'
-