浏览代码

alias-finder: fix wc numeric conditional (#8251)

Never use `[[` for numeric comparisons, for that, we’ll use `((`.
Vice Versa 4 年之前
父节点
当前提交
e363109a6d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/alias-finder/alias-finder.plugin.zsh

+ 1 - 1
plugins/alias-finder/alias-finder.plugin.zsh

@@ -14,7 +14,7 @@ alias-finder() {
     esac
   done
   cmd=$(sed 's/[].\|$(){}?+*^[]/\\&/g' <<< $cmd) # adds escaping for grep
-  if [[ $(wc -l <<< $cmd) == 1 ]]; then
+  if (( $(wc -l <<< $cmd) == 1 )); then
     while [[ $cmd != "" ]]; do
       if [[ $longer = true ]]; then
         wordStart="'{0,1}"