diff options
-rwxr-xr-x | easy_e17.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/easy_e17.sh b/easy_e17.sh index eafcec1..a673b59 100755 --- a/easy_e17.sh +++ b/easy_e17.sh @@ -1002,9 +1002,10 @@ function run_command () function find_local_path () { name=$1 - path=$(find $src_path -maxdepth 5 -type d -name $name | grep -v -E "^${src_path}$" | grep -v -E "$ignore_dirs_re" | \ + 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) - if [ "$path" ]; then echo "$path"; fi + if [ "$path" ]; then echo "$src_path/$path"; fi } function compile () |