X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=.bashrc;h=77178337d2b3d44342af25c276ca9ed42b5288b8;hb=ac79bb2f47a96158ec7d00e18acf6c938f2ab5b3;hp=05bb4138c2de435a3ec83f102a2ecb9db7d83e9c;hpb=bd7ee39d894565efb790b36db991be91a90b8fb8;p=config-20-100.git diff --git a/.bashrc b/.bashrc index 05bb413..7717833 100644 --- a/.bashrc +++ b/.bashrc @@ -45,12 +45,17 @@ fi # des infos quand on est dans un dépôt versionné find_up () { + local path normalized_path normalized_ret path="$1" shift 1 - while [[ "`readlink -f -- \"$path\"`" != "/" ]]; + normalized_path=`readlink -f -- "$path"` + normalized_ret=$? + while [[ "$normalized_path" != "/" ]] && [ $normalized_ret -eq 0 ]; do find "$path" -maxdepth 1 -mindepth 1 "$@" path=${path}/.. + normalized_path=`readlink -f -- "$path"` + normalized_ret=$? done }