diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-11-15 16:18:38 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-11-15 16:18:38 +0100 |
commit | 4554ce218bbf81cc8d4db19e270819d589ccfb31 (patch) | |
tree | b791f8e482709e6f6f23e6d39071eec2ac8724a3 | |
parent | e127602dc5cf2e1114d8e73bc9f7016926551012 (diff) | |
download | bin-4554ce218bbf81cc8d4db19e270819d589ccfb31.zip bin-4554ce218bbf81cc8d4db19e270819d589ccfb31.tar.gz |
easy_e17.sh: find_local_path: count '/' occurences instead of path length
-rwxr-xr-x | easy_e17.sh | 2 |
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 } |