]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Using -iname at find action
authorrhatto <rhatto@ratatosk.fluxo.info>
Tue, 18 Mar 2014 00:10:10 +0000 (21:10 -0300)
committerrhatto <rhatto@ratatosk.fluxo.info>
Tue, 18 Mar 2014 00:10:10 +0000 (21:10 -0300)
lib/keyringer/actions/find
lib/keyringer/functions

index 9b18d66891ab7190054dda76ee6925b10eb30bb8..21afc7a7096f392297c2f71d45f1ec8a1d12cbd5 100755 (executable)
@@ -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"
index 42850b9abdbdb0db17388617a96a2e86d06e961b..7840b04b8cb780b21e867a873959838bbbee5431 100755 (executable)
@@ -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:"