summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-11-15 16:18:38 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2011-11-15 16:18:38 +0100
commit4554ce218bbf81cc8d4db19e270819d589ccfb31 (patch)
treeb791f8e482709e6f6f23e6d39071eec2ac8724a3
parente127602dc5cf2e1114d8e73bc9f7016926551012 (diff)
downloadbin-4554ce218bbf81cc8d4db19e270819d589ccfb31.zip
bin-4554ce218bbf81cc8d4db19e270819d589ccfb31.tar.gz
easy_e17.sh: find_local_path: count '/' occurences instead of path length
-rwxr-xr-xeasy_e17.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/easy_e17.sh b/easy_e17.sh
index 7cf1d7c..adab900 100755
--- a/easy_e17.sh
+++ b/easy_e17.sh
@@ -1004,7 +1004,7 @@ function find_local_path ()
name=$1
re_src_path=$(echo $src_path | sed 's/\//\\\//g')
path=$(find $src_path -maxdepth 5 -type d -name $name | sed -e "s/$re_src_path\///" | grep -v -E "^${src_path}$" | grep -v -E "$ignore_dirs_re" | \
- while read line; do echo `echo $line | wc -c` $line; done | sort -n | head -n 1 | cut -d " " -f 2)
+ while read line; do echo $(echo $line | grep -o '/' | wc -l) $line; done | sort -n | head -n 1 | cut -d " " -f 2)
if [ "$path" ]; then echo "$src_path/$path"; fi
}