From: Andre Noll Date: Wed, 16 Apr 2014 18:22:38 +0000 (+0000) Subject: gsu/gui: Fix regex for tree walk. X-Git-Url: http://git.tuebingen.mpg.de/?p=gsu.git;a=commitdiff_plain;h=ced36439642170f319be76187907bccc2ea32ce0;ds=sidebyside gsu/gui: Fix regex for tree walk. If one directory name is a suffix of another, the regex for grep found both, which is bad. --- diff --git a/misc/gsu/gui b/misc/gsu/gui index 5b108e1..12c8b8b 100644 --- a/misc/gsu/gui +++ b/misc/gsu/gui @@ -154,7 +154,7 @@ _get_subtree() local tree="$1" root="${2%/}" local TAB=' ' - first="$(grep -n "$root/" <<< "$tree")" + first="$(grep -n "$TAB\{1,\}$root/" <<< "$tree")" [[ -z "$first" ]] && return line_num="${first%%:*}"