From: rhatto Date: Tue, 18 Mar 2014 00:10:10 +0000 (-0300) Subject: Using -iname at find action X-Git-Tag: 0.3.3~2 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=c77565e1e2ac774659c125b2ca14f18d9f56f0cf;p=keyringer.git Using -iname at find action --- diff --git a/lib/keyringer/actions/find b/lib/keyringer/actions/find index 9b18d66..21afc7a 100755 --- a/lib/keyringer/actions/find +++ b/lib/keyringer/actions/find @@ -15,5 +15,5 @@ shift ARGS="`echo "$*" | sed -e "s|^/*||"`" # Run find command -cd "$KEYDIR/$RELATIVE_PATH" && find | grep -i "$ARGS" | sed -e 's|^./||g' +cd "$KEYDIR/$RELATIVE_PATH" && find -iname "*$ARGS*" | sed -e 's|^./||g' cd "$CWD" diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 42850b9..7840b04 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -429,7 +429,7 @@ function keyringer_get_file { elif [ ! -f "$KEYDIR/$FILE" ]; then # Try to find a similar file count=0 - candidates=(`keyringer_exec find "$BASEDIR" | grep -i "$1" | grep -e '.asc$'`) + candidates=(`keyringer_exec find "$BASEDIR" "$1*.asc"`) if [ ! -z "$candidates" ]; then echo "Could not find exact match for \"$1\", please choose one of the following secrets:"