From 89d1672fb0093de23c7e1ce921f2d0a8662ddc81 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 5 Dec 2024 01:51:33 +0000 Subject: [PATCH] [defn]: Handle escaped characters in definition and missing words --- defn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defn b/defn index b71cd47..82b048a 100755 --- a/defn +++ b/defn @@ -1,4 +1,4 @@ #!/bin/sh # Script to look up word in dictionary file in the format: "word:\tdefinition\n" -rg --no-line-number "^$1:" ~/.local/share/dictionary.txt +printf "$(rg --no-line-number "^$1:" ~/.local/share/dictionary.txt || echo 'No definition found. The searched term may not be in the dictionary file, or the dictionary file may not be present')\n"